TradeChartist Plotter™TradeChartist Plotter is an extremely useful and adaptive indicator that connects to any oscillator to plot highs and lows, Divergences and also Bull and Bear Zones based on the Oscillator and user input to filter zones. When plotted as normal or Heikin Ashi price bars/candles, the divergences can be plotted on price bars and in addition ™TradeChartist MA Visualizer can be plotted and used to filter trade zones derived from the Oscillator connected.
===================================================================================================================
™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗣𝗹𝗼𝘁𝘁𝗲𝗿 𝗨𝘀𝗲𝗿 𝗠𝗮𝗻𝘂𝗮𝗹
===================================
To connect an oscillator to ™TradeChartist Plotter, follow the steps below.
From the ╔═══ 𝗣𝗹𝘂𝗴 𝗢𝘀𝗰𝗶𝗹𝗹𝗮𝘁𝗼𝗿 ═══ 🔌 dropdown, choose the Oscillator plot which is active on the chart.
Choose the Oscillator Smoothing factor if smoothing is not available on the original oscillator plot by using the Osᴄɪʟʟᴀᴛᴏʀ Sᴍᴏᴏᴛʜɪɴɢ input box.
Enter Upper and Lower Bands for the Oscillator plot that helps detect Highs/Lows, Divergences, Trade Zones etc. by using the Uᴘᴘᴇʀ Bᴀɴᴅ and Lᴏᴡᴇʀ Bᴀɴᴅ input boxes. For example, for oscillators like RSI, bands can be 60/40 or 70/30 or even 50/50 to help filter highs/lows on Oscillator and the main price chart based on Oscillator values above Upper Band and Oscillator values below Lower Band.
Osᴄɪʟʟᴀᴛᴏʀ Bᴀsᴇ Lɪɴᴇ is required especially for Oscillators that don't have 0 as its base line. For example, RSI, Stochastic etc. oscillate between 0 and 100. For Oscillators like these, a base line value is really useful on ™TradeChartist Plotter especially to detect Divergences, Highs/Lows, Trade Zones and even to plot the Oscillator as a Histogram or Area plot.
Pʟᴏᴛ Bᴀsᴇ Lɪɴᴇ ᴀɴᴅ Bᴀɴᴅs plots base line and the bands if Oscillator plot is chosen.
There are three plot types under Pʟᴏᴛ Tʏᴘᴇ and they are
══ Plot Oscillator - This option plots the connected Oscillator
══ Plot Price Candles - This option plots price candles and if overlaid on main chart, Highs/Lows, Divergences etc can be visualized along with ™TradeChartist MA Visualizer if enabled.
══ Plot Price Bars - This option plots price bars and if overlaid on main chart, Highs/Lows, Divergences etc can be visualized along with ™TradeChartist MA Visualizer if enabled.
Pʟᴏᴛ HA Cᴀɴᴅʟᴇs/Bᴀʀs plots Heikin Ashi candles/bars. It doesn't affect the Oscillator plot or in anyway alter the Oscillator plot.
Pʟᴏᴛ Sᴛʏʟᴇ dropdown has three types of styles - Line, Histogram and Area plot styles for the Oscillator plot.
Pʟᴏᴛ Pʀɪᴄᴇ Hɪɢʜs ᴀɴᴅ Lᴏᴡs plots the price highs and price lows corresponding to the Bull and Bear zones of the Oscillator connected.
===================================================================================================================
╔═════════ 𝗠𝗔 𝗩𝗶𝘀𝘂𝗮𝗹𝗶𝘇𝗲𝗿 ═════════╗
MA Visualizer is a powerful and very useful original ™TradeChartist visual method to plot Moving Averages of the close price of the security for user specified look back period in a visually appealing style in the form of colour coded bands. MA Visualizer not only helps the trader spot the price action of the security relative to the moving average, but also paints a visual picture of the trend strength, which must be seen and used on chart to appreciate its elegance. One of 15 different types of Moving Averages can be used to visualize the price action.
Activate 𝗠𝗔 𝗩𝗶𝘀𝘂𝗮𝗹𝗶𝘇𝗲𝗿 and choose the MA type from MA Vɪsᴜᴀʟɪᴢᴇʀ Tʏᴘᴇ dropdown and entering the lookback period in MA Vɪsᴜᴀʟɪᴢᴇʀ ᴘᴇʀɪᴏᴅ input box.
MA Visualizer colour theme can be be changed from MA Vɪsᴜᴀʟɪᴢᴇʀ Cᴏʟᴏʀ Sᴄʜᴇᴍᴇ dropdown.
The faster of the two set of bands that form the MA Visualizer reacts to price action faster and can be clearly seen from its change of colour from Bull Colour to Bear Colour or vice-versa earlier than the slower set of bands. The fill colour between the bands also helps the user stay in a trade or exit a trade based on other confirmators.
Enabling Dᴀᴢᴢʟɪɴɢ Vɪsᴜᴀʟɪᴢᴇʀ makes the Visualizer dazzle. Uncheck this option for normal view of MA Visualizer.
𝐔𝐬𝐞 𝐌𝐀 𝐕𝐢𝐬𝐮𝐚𝐥𝐢𝐳𝐞𝐫 𝐚𝐬 𝐓𝐫𝐚𝐝𝐞 𝐅𝐢𝐥𝐭𝐞𝐫 filters the trade zones based on MA Visualizer's trend agreeing with the Oscillator trend. Fɪʟᴛᴇʀ Eᴀʀʟʏ Vɪsᴜᴀʟɪᴢᴇʀ Bʀᴇᴀᴋᴏᴜᴛs filters the trades based on faster MA Visualizer plot's trend.
Also, enabling Pʟᴏᴛᴛᴇʀ Bᴀᴄᴋɢʀᴏᴜɴᴅ Fɪʟʟ under 𝗨𝘀𝗲𝗳𝘂𝗹 𝗘𝘅𝘁𝗿𝗮𝘀 helps detect the trade zones with or without the MA Visualizer filter enabled.
===================================================================================================================
╔═══════ 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 ═══════╗
Plotter detects both Regular and Hidden Bullish (in a Bear Zone) and Bearish Divergences (in a Bull Zone) at every occurence based on the Oscillator connected. This can be filtered by the use of filtering by Upper and Lower Band values in the Oscillator section. Divergences can also be plotted on price bars based on Pʟᴏᴛ Tʏᴘᴇ .
To plot divergences, enable 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀, Sʜᴏᴡ Rᴇɢᴜʟᴀʀ Dɪᴠᴇʀɢᴇɴᴄᴇs and Sʜᴏᴡ Hɪᴅᴅᴇɴ Dɪᴠᴇʀɢᴇɴᴄᴇs .
Users can further filter Divergences by entering the number of bars to the right in Rɪɢʜᴛ ʙᴀʀs ғᴏʀ Pɪᴠᴏᴛ Cᴏɴғɪʀᴍᴀᴛɪᴏɴ input box to confirm the Price Pivot (for Regular divergences) and Oscillator Pivot (for Hidden Divergences).
Note: Divergences can not be traded at every instance or as a standalone indicator. It just indicates a possibility of strength exhaustion and should not be trusted during a trending market. Higher smoothing (done sensibly) also filters divergences. Divergence can be a strong confirmator once a reversal is detected. For example, using MA Visualizer can help confirm a divergence and vice-versa to identify the trend changes. This means that the confirmations may happen after a few bars since the divergence in agreement with the MA Visualizers trend change.
The example chart of 4hr BTC-USDT chart shows the Divergences filtered by use of RSI 60/40 bands, MA Visualizer and Regression channel trends. It is important to note that the trend intensity colour on the plot and bars (if bar colour option is enabled) will help detect if the Divergence would hold.
===================================================================================================================
╔═══════ 𝗨𝘀𝗲𝗳𝘂𝗹 𝗘𝘅𝘁𝗿𝗮𝘀 ═══════╗
Pʟᴏᴛᴛᴇʀ Bᴀᴄᴋɢʀᴏᴜɴᴅ Fɪʟʟ - Plots background fill based on Bull and Bear Zones based on the Oscillator connected and the filters used.
Plotter offers two vibrant Colour Themes, namely Chilli and Flame , which can be opted from Pʟᴏᴛᴛᴇʀ Tʜᴇᴍᴇ dropdown. These themes also offer the option to plot the trend intensity on the price bars as bar colours by enabling Cᴏʟᴏᴜʀ Bᴀʀs . Bar colors can also be inverted using Iɴᴠᴇʀᴛ Bᴀʀ Cᴏʟᴏᴜʀ option.
Users can also choose to use the Simple theme and choose preferred colours from Sɪᴍᴘʟᴇ Tʜᴇᴍᴇ ʙᴜʟʟ Cᴏʟᴏᴜʀ and Sɪᴍᴘʟᴇ Tʜᴇᴍᴇ ʙᴇᴀʀ Cᴏʟᴏᴜʀ colour input.
Note : The indicator does not repaint and can be confidently used for alerts and trade entries without worrying about plots disappearing after bar close.
===================================================================================================================
Example Charts
1. EUR-USD 15m chart with 3 Plotters on chart, 1 with ™TradeChartist MDO , 1 on main chart and 1 HA Bar chart showing various ways of plotting highs/lows, divergences and Trade zones using 55 period LSMA MA Visualizer.
2. XAU-USD 15m chart with Chande Momentum Oscillator connector to Plotter with 200 period SMA Visualizer used as Trade Filter.
3. LINK-USDT 1hr chart with ™TradeChartist Risk Meter connected to Plotter with 144 period Hull MA Visualizer as Trade filter on Main chart with Divergences plotted based on Risk Meter Volatility Risk Oscillator.
4. Example 3 above with Plotter's Trend Identifier connected to ™TradeChartist Plug and Trade as Oscillatory Signal with Past performance and trades plotted.
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
Tìm kiếm tập lệnh với "the script"
BRAHMA - Better Remodelled Adaptive Holistic Moving Average™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗕𝗥𝗔𝗛𝗠𝗔 (Better Remodelled Adaptive Holistic Moving Average) is an exceptionally versatile Moving Average, that can adapt, expand and transform into a better Moving Average system that consists of BRAHMA bands and BRAHMA steps, both emanating from a singular plot based on the source price and the lookback length. The system also consists of BRAHMA cloud which is based on the source price, the lookback length, the step length and the cloud factor. In addition to using the source price directly, the indicator offers 15 different Moving Average types that can be used on the source price for BRAHMA system to adapt to, offering several possibilities to visualize and trade the price action.
===================================================================================================================
™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗕𝗥𝗔𝗛𝗠𝗔 𝗨𝘀𝗲𝗿 𝗠𝗮𝗻𝘂𝗮𝗹
=====================================
Like any other moving average system, the source price and the lookback length determines the dynamic of BRAHMA . Source price can be selected from Sᴏᴜʀᴄᴇ dropdown and the lookback length can be enetered in the Bʀᴀʜᴍᴀ Lᴇɴɢᴛʜ input box. MA ᴛʏᴘᴇ dropdown is used to choose the type of moving average for BRAHMA to adapt to. To use the source price directly, Use Source must be selected from the dropdown.
In addition to this usual requirement, Bʀᴀʜᴍᴀ Wɪᴅᴛʜ and Bʀᴀʜᴍᴀ Sᴛᴇᴘ Lᴇɴɢᴛʜ are required to make BRAHMA moving average system complete, based on risk and reward expectations of the user.
===================================================================================================================
BRAHMA Bands and Steps
The Bands and the Steps are integral part of the BRAHMA system. When the Bʀᴀʜᴍᴀ Wɪᴅᴛʜ and Bʀᴀʜᴍᴀ Sᴛᴇᴘ Lᴇɴɢᴛʜ values are 1, the bands and steps lie dormant inside BRAHMA and they emanate from the main plot as the values are increased.
Bʀᴀʜᴍᴀ Wɪᴅᴛʜ impacts the Bands Mean line + expands or contracts the bands and Bʀᴀʜᴍᴀ Sᴛᴇᴘ Lᴇɴɢᴛʜ transforms the dormant step system (on minimum value of 1) from inside the BRAHMA bands into a powerful step/block like structure that helps find support/resistance levels and displays Bull and Bear zones based on price action in relation to the BRAHMA bands and BRAHMA steps .
Dɪsᴘʟᴀʏ Bʀᴀʜᴍᴀ Sᴛᴇᴘs plots the steps
Dɪsᴘʟᴀʏ Bʀᴀʜᴍᴀ Bᴀɴᴅs plots the bands
Enabling Cᴏʟᴏᴜʀ Bᴀʀs with Bands and Steps displayed will plot the Bull and Bear Zones on price bars and this dynamic is very different from the colouring of the bars based on the cloud as a standalone plot.
===================================================================================================================
BRAHMA Cloud
The cloud is a very useful part of this system and helps see the price action with the help of volatility of Bulls/Bears based on the lookback length, step length and the cloud factor. Price above or below the cloud helps visualize the strength of the trend along with the height/thickness of the cloud. Thinning of the cloud can signal reversals and can be used with another confirmator.
Cʟᴏᴜᴅ Fᴀᴄᴛᴏʀ (1 - 10) affects the cloud dynamic and can be changed to suit personal risk strategy and trade frequency. Cloud sensitivity is also affected by the Bʀᴀʜᴍᴀ Lᴇɴɢᴛʜ . Cloud can be used on its own with really low lookback length (even length of 1 works well).
Dɪsᴘʟᴀʏ Bʀᴀʜᴍᴀ Cʟᴏᴜᴅ plots the cloud
Enabling Bʀᴀʜᴍᴀ Cᴏʟᴏᴜʀ Bᴀʀs with Cloud displayed as the only standalone component of the indicator will plot the Bull and Bear Zones and this dynamic is very different from the colouring of the bars based on the Bands and Steps on chart. When the price enters the cloud from below after or during a period of downtrend will start painting Bull colour and when the price enters the cloud from above after or during a period of uptrend will start painting Bear colour on the price bars.
===================================================================================================================
BRAHMA Colour Scheme
The colours of the plots and fills can be changed based on user preference from the indicator settings.
There are three Themes to choose from Bʀᴀʜᴍᴀ Cᴏʟᴏᴜʀ Bᴀʀs Tʜᴇᴍᴇ (Simple, Chilli and Flame) dropdown to colour the price bars.
Enabling Bʀᴀʜᴍᴀ Cᴏʟᴏᴜʀ Bᴀʀs with Simple Theme colours the price bars based on Bull and Bear zones as explained in the sections above. Chilli and Flame themes colour the price bars with trend intensity for every bar based on the source price and lookback length.
===================================================================================================================
Alerts
Alerts can be created for Long and Short entries by using Once Per Bar Close as Alert Frequency. Entries are generated on Real time bars. It is recommended to wait for bar close before taking a position based on Trade Entries.
The indicator does not repaint and can be confidently used for alerts and trade entries without worrying about signals disappearing.
™TradeChartist BRAHMA can also be connected to ™TradeChartist Plug and Trade using 𝗕𝗥𝗔𝗛𝗠𝗔 𝗧𝗿𝗲𝗻𝗱 𝗜𝗱𝗲𝗻𝘁𝗶𝗳𝗶𝗲𝗿 as Oscillatory Signal to generate entries along with Targets, Stop Loss plots etc. Target and Stop Loss alerts can be created using Plug and Trade's Alerts system.
===================================================================================================================
Example Charts
1. The 15m chart below demonstrates how a Simple Moving Average can be transformed from a noisy pretty much untradeable MA plot to meaningful Moving Average Trade System using BRAHMA by adjusting the Width and the Step Length.
2. GBP-USD 1hr chart using 34 period Zero-Lag EMA with 21 width and 24 step length (24 hrs in a Daily candle - This helps choose length for HTF based levels)
3. NIFTY 1hr chart using 21 period TEMA (Triple Exponential MA) with 21 width and 24 step length.
4. XAU-USD Daily chart using 89 period TEMA with 24 width and 12 step length, enabling Chilli Theme based colour bars.
5. LINK-USDT 1hr chart using 21 period Hull MA with 24 width, 24 step length and cloud factor of 2 visualised using colour bars on cloud as standalone plot.
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
TradeChartist Drifter™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗗𝗿𝗶𝗳𝘁𝗲𝗿 is an adeptly designed, functional and a visual indicator that plots trend-following Support and Resistance walls by employing the concepts of Trend-based Support and Resistance, Momentum and Volatility, based on user defined lookback length, and includes three extremely useful Visualizers - Drift Bands Visualizer , Drift Strength Visualizer and Drifter AutoFibs Visualizer to help visualize the Price action in relation to the Support and Resistance Walls.
===================================================================================================================
™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗗𝗿𝗶𝗳𝘁𝗲𝗿 𝗨𝘀𝗲𝗿 𝗠𝗮𝗻𝘂𝗮𝗹
===================================
Concept of Drift
™TradeChartist Drifter combines concepts of Trend-based Support and Resistance, Momentum and Volatility to plot continuous Drifter Support and Resistance Walls that encloses the price action ( Drift ) within it (If the source price is price candle/bar based price like open,close,high,low,hl2,hl3 or ohlc4). In fact, these walls are generated by the price action ( Drift ) itself and helps the user see the price trend clearly as price makes higher highs/lows and lower highs/lows.
The Drifter walls are based on the user defined lookback length which can be changed in the Lᴇɴɢᴛʜ ғᴏʀ Dʀɪғᴛᴇʀ Wᴀʟʟs input box.
Drifter walls can be viewed or hidden by enabling or disabling 𝐒𝐡𝐨𝐰 𝐃𝐫𝐢𝐟𝐭𝐞𝐫 𝐖𝐚𝐥𝐥𝐬 .
Price Highs and Lows breaching the Drifter Walls can be viewed or hidden by enabling or disabling Sʜᴏᴡ Dʀɪғᴛᴇʀ Hɪɢʜs ᴀɴᴅ Lᴏᴡs .
Understanding and Visualizing ( Drift ) is important as it helps traders see the price action clearly. Price Volatility, Trend and Momentum are dependent on the period they are analysed. In order to visualize the drift, the user must enter the number of bars lookback in the Dʀɪғᴛ Lᴏᴏᴋʙᴀᴄᴋ input box.
===================================================================================================================
Three Types of Visualizers
One of the three types of Visualizers can be selected from Vɪsᴜᴀʟɪᴢᴇʀ Tʏᴘᴇ dropdown.
Drifter AutoFibs Visualizer is dependent on the Lᴇɴɢᴛʜ ғᴏʀ Dʀɪғᴛᴇʀ Wᴀʟʟs only as it fills the Drifter with Automatic Fibonacci Levels based on the distance between the Drifter Walls.
Drift Strength Visualizer is dependent on the Dʀɪғᴛ Lᴏᴏᴋʙᴀᴄᴋ only as it detects the Drift Strength based on Drift length. This Visualizer detects the Bull and the Bear zones based on the lookback. This helps visualize the Trend and Momentum clearly as the zones are filled with user selected theme based Bull and Bear colours.
Drift Bands Visualizer plots Drift Bands based on either Average True Range (ATR) or Standard Deviation along with the Bull or Bear Trend clearly shown using the color of the Mean or Basis line of the Drift Bands.
===================================================================================================================
╔═════════ 𝗗𝗿𝗶𝗳𝘁 𝗕𝗮𝗻𝗱𝘀 ══════════╗
Drift Bands are based on either ATR or Standard Deviation and consists of an Upper Band, a Lower Bands and a Mean or Basis Line. Drift Bands are extremely effective and highly useful in spotting the trend as the breakout from the upper or the lower band signals a change in the Drift based on the Dʀɪғᴛ Lᴏᴏᴋʙᴀᴄᴋ .
Note: The Mean or the Basis line of the Drift Bands depends only on the Dʀɪғᴛ Lᴏᴏᴋʙᴀᴄᴋ and Sᴏᴜʀᴄᴇ price. To plot Drift Bands based on external source, enable Usᴇ Sᴏᴜʀᴄᴇ Pʀɪᴄᴇ . The Width of the Bands is affected by ATR or Standard Deviation, based on the user preference.
ATR based Drift Bands
To plot ATR based Drift bands, enable 𝐀𝐓𝐑 𝐁𝐚𝐧𝐝𝐬 - Uɴᴄʜᴇᴄᴋ ғᴏʀ Sᴛᴀɴᴅᴀʀᴅ Dᴇᴠɪᴀᴛɪᴏɴ . ATR period is automatic. The ATR factor or the ATR multiplier can be changed in ATR Mᴜʟᴛɪᴘʟɪᴇʀ (ғᴏʀ ᴀᴛʀ ʙᴀsᴇᴅ ʙᴀɴᴅs (Default - 1, Min - 0.5, Max - 3). Higher ATR multiplier increases the width of the Drift Bands.
Note: In most cases, higher ATR multiplier of 2 or 3 increases Risk, but also results in increased Gains.
Standard Deviation based Drift Bands
To plot Standard Deviation bases Drift Bands, disable 𝐀𝐓𝐑 𝐁𝐚𝐧𝐝𝐬 - Uɴᴄʜᴇᴄᴋ ғᴏʀ Sᴛᴀɴᴅᴀʀᴅ Dᴇᴠɪᴀᴛɪᴏɴ . Both Sᴛᴀɴᴅᴀʀᴅ Dᴇᴠɪᴀᴛɪᴏɴ Lᴇɴɢᴛʜ (Default - 55, Min - 13) and Sᴛᴀɴᴅᴀʀᴅ Dᴇᴠɪᴀᴛɪᴏɴ Mᴜʟᴛɪᴘʟɪᴇʀ (Default - 1, Min - 0.236, Max - 2) affect the width of the Bands. Higher Standard Deviation Multiplier increases the Volatility of the Drift Bands.
Note: In most cases, higher Standard Deviation multiplier increases Risk, but also results in increased Gains.
Tip : To plot Bull and Bear Drift Zones, enable 𝐃𝐫𝐢𝐟𝐭 𝐙𝐨𝐧𝐞𝐬 𝐁𝐚𝐜𝐤𝐠𝐫𝐨𝐮𝐧𝐝 𝐅𝐢𝐥𝐥 and this can be used as Trade zones as this will be in sync with the trend colour of Mean line of the Drift Bands.
===================================================================================================================
╔═══════ 𝗗𝗿𝗶𝗳𝘁𝗲𝗿 𝗔𝗲𝘀𝘁𝗵𝗲𝘁𝗶𝗰𝘀 ═══════╗
There are two themes (Chilli and Flame) to choose from for the colour schemes of Drifter under 𝗗𝗿𝗶𝗳𝘁𝗲𝗿 𝗧𝗵𝗲𝗺𝗲 dropdown.
Dʀɪғᴛᴇʀ Bᴀᴄᴋɢʀᴏᴜɴᴅ Fɪʟʟ plots Bull and Bear strength based background fill between the Drifter walls. This is disabled for Drifter AutoFibs Visualizer .
There are two types of background fills namely, Mean Reversion and Trend Following and can be selected from Bᴀᴄᴋɢʀᴏᴜɴᴅ Fɪʟʟ Tʏᴘᴇ dropdown.
Enabling Dʀɪғᴛᴇʀ Cᴏʟᴏᴜʀ Bᴀʀs paints the price bars with the Drifter background fill.
Note: Trend Following fill is dependent on Dʀɪғᴛ Lᴏᴏᴋʙᴀᴄᴋ .
===================================================================================================================
Alerts
Alerts can be created for Long and Short entries by using Once Per Bar Close as Alert Frequency. Entries are generated on Real time bars based on Drift Bands Breakout conditions. It is recommended to wait for bar close before taking a position based on Drift Bands Trade Entries.
The indicator does not repaint and can be confidently used for alerts and trade entries without worrying about signals disappearing.
™TradeChartist Drifter can also be connected to ™TradeChartist Plug and Trade using 𝗗𝗿𝗶𝗳𝘁𝗲𝗿 𝗧𝗿𝗲𝗻𝗱 𝗜𝗱𝗲𝗻𝘁𝗶𝗳𝗶𝗲𝗿 as Oscillatory Signal to generate entries along with Targets, Stop Loss plots etc. Target and Stop Loss alerts can be created using Plug and Trade's Alerts system.
===================================================================================================================
There are several combinations of settings that can be tested on the security traded based on timeframe and risk/reward expectations. The indicator can be used for trade entries with various Drift Bands settings. Following are a few examples using the Drifter.
===================================================================================================================
Example Charts
1. SPX 1hr chart using Drifter AutoFibs Visualizer based on 100 period lookback for Drifter Walls.
2. SPX 1hr chart using Drift Strength Visualizer based on 100 period Drift Lookback.
3. SPX 1hr chart using 100 period ATR (Multiplier - 1) based Drift Bands Visualizer with Drift Zones Background Fill.
4. SPX 1hr chart using 50 period ATR (Multiplier - 1) based Drift Bands Visualizer with Drift Zones Background Fill.
5. SPX 1hr chart using 50 period Standard Deviation (Length - 21, Multiplier - 2) based Drift Bands Visualizer with Drift Zones Background Fill.
6. EUR-USD 1hr chart using 34 period ATR (Multiplier - 3) based Drift Bands Visualizer with Drift Zones Background Fill.
7. BTC-USD 5m chart using 34 period ATR (Multiplier - 3) based Drift Bands Visualizer connected to ™TradeChartist Intensity Equilibrium Line.
8. BTC-USD 5m chart using 34 period ATR (Multiplier - 3) based Drift Bands Visualizer connected to ™TradeChartist Intensity Equilibrium Line + Connected to ™TradeChartist Plug and Trade
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
TradeChartist Risk Meter™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗥𝗶𝘀𝗸 𝗠𝗲𝘁𝗲𝗿 is a very useful and a well designed indicator, that packs a range of Risk utility tools including Trend Based Stochastic Oscillator, Bollinger Bands %B , Volatility Risk Oscillator, RSI Oscillator and RSI Risk Oscillator, along with further visual risk assessment tools like Divergence Spotter, Trend based Strength detector among other useful extras.
===================================================================================================================
™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗥𝗶𝘀𝗸 𝗠𝗲𝘁𝗲𝗿 𝗨𝘀𝗲𝗿 𝗠𝗮𝗻𝘂𝗮𝗹
The user can choose from one of the following four option from the 𝗥𝗶𝘀𝗸 𝗠𝗲𝘁𝗲𝗿 𝗧𝘆𝗽𝗲 dropdown from the settings.
1. Trend Based Stochastic
2. Bollinger Bands %B
3. Volatility Risk Oscillator
4. RSI + RSI Risk Oscillator
The source price for the Risk Meter can be chosen from Sᴏᴜʀᴄᴇ dropdown. Both Trend Based Stochastic and Volatility Risk Oscillator use High/Low prices as default. Enable Usᴇ Sᴏᴜʀᴄᴇ Pʀɪᴄᴇ under respective section to use a different source price.
Users can choose to plot Risk Meter background fill by enabling or disabling Rɪsᴋ Mᴇᴛᴇʀ Bᴀᴄᴋɢʀᴏᴜɴᴅ . The background fill is based on the trend intensity and uses 2 different colour schemes based on user preference. When the Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ is used, it uses the background fill to mask the zone. If background fill is disabled, orange colour is used to mask the zone.
All of the Risk Meter plots can be plotted as Line , Histogram or Area plots and each of the sections include the Pʟᴏᴛ Sᴛʏʟᴇ option, so the user can choose a specific type of plot style for each of the Risk Meter Oscillators, based on user preference.
===================================================================================================================
═══ 𝟭. 𝗧𝗿𝗲𝗻𝗱 𝗕𝗮𝘀𝗲𝗱 𝗦𝘁𝗼𝗰𝗵𝗮𝘀𝘁𝗶𝗰 ═══
Trend Based Stochastic Oscillator is a modified version of the classic Stochastic Oscillator with the difference being the limits and also the plot itself to an extent.
--> Trend based Stochastic is a single plot oscillates between -100 to +100 and occasionally breaches these limits and can signal extremely overbought or oversold conditions unlike classic Stochastic indicator, which has two plots and strictly oscillates between 0-100.
--> Trend based Stochastic is extremely sensitive to price action, making it possible to detect every single divergence, both regular and hidden, even with the default smoothing factor of 5
--> Risk Meter employs Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ to let user choose the threshold limit and only from this point onwards, Risk Meter detects the divergences. This helps filter a lot of noise in addition to Price and Oscillator Pivot detection under 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 section.
The user has to choose the length for the Trend based Stochastic plot by entering number of bars in Lᴏᴏᴋʙᴀᴄᴋ Lᴇɴɢᴛʜ input box (Default value is 55). The user can also change the smoothing factor from default value of 5 by entering the value in Sᴍᴏᴏᴛʜɪɴɢ input box. Smoothing is particularly useful to detect the strength, based on the trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and the required trend length is entered in Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. HIgher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
===================================================================================================================
════ 𝟮. 𝗕𝗼𝗹𝗹𝗶𝗻𝗴𝗲𝗿 𝗕𝗮𝗻𝗱𝘀 %𝗕 ═════
Bollinger Bands %B in Risk Meter oscillates between -100 to +100 rather than 0 - 1 in the classic version, with oversold/overbought levels breaching the limits and the plot is exactly the same otherwise.
Risk Meter employs Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ for Bollinger Bands %B to let the user choose the threshold limit and only from this point onwards, Risk Meter detects the divergences. This helps filter a lot of noise in addition to Price and Oscillator Pivot detection under 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 section.
The user has to choose the Simple Moving Average (SMA) length for the plot by entering number of bars in BB SMA Lᴇɴɢᴛʜ input box (Default value is 20). There is no need for Standard Deviation as the fundamental plot is exactly the same, given that the plot oscillates between -100 to +100. The user can also change the smoothing factor from default value of 5 by entering the value in Sᴍᴏᴏᴛʜɪɴɢ input box. Smoothing is particularly useful to detect the strength, based on the trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and the required trend length is entered in Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. HIgher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
===================================================================================================================
══════ 𝟯. 𝗩𝗼𝗹𝗮𝘁𝗶𝗹𝗶𝘁𝘆 𝗥𝗶𝘀𝗸 ═══════
Volatility Risk Oscillator is an original ™TradeChartist model designed to visually see the Volatility risk for the security on any time frame.
To plot Volatility Risk for the security, the user has to enter the number of bars to detect volatility risk in Lᴏᴏᴋʙᴀᴄᴋ Lᴇɴɢᴛʜ input box (Default Value is 55). The user can also change the smoothing factor from default value of 5 by entering the value in Sᴍᴏᴏᴛʜɪɴɢ input box. Smoothing is particularly useful to detect the strength based on trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and required trend length is entered in Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. HIgher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
Even though Divergences work on Volatility Risk Oscillator, it is not employed as it produces far too many and there is no set Threshold limit that can be set to filter the divergences.
===================================================================================================================
══════ 𝟰. 𝗥𝗦𝗜 𝗢𝘀𝗰𝗶𝗹𝗹𝗮𝘁𝗼𝗿 ═══════
There are two different types of RSI Oscillators in this section that can be plotted.
RSI Oscillator - Classic RSI modified to fit -100 to +100 scale rather than 0 - 100 scale. Risk Meter employs Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ for RSI Oscillator also, to let the user choose the threshold limit and only from this point onwards, Risk Meter detects the divergences. This helps filter a lot of noise in addition to Price and Oscillator Pivot detection under 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 section.
RSI Risk Oscillator - This oscillator plots the potential RSI risk based on RSI length (which can be changed in RSI Lᴇɴɢᴛʜ input box and main source price ( Sᴏᴜʀᴄᴇ ). The user can also change the smoothing factor from default value of 5 by entering the value in Sᴍᴏᴏᴛʜɪɴɢ input box. Smoothing is particularly useful to detect the strength, based on the trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and the required trend length is entered in Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. Higher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
To plot RSI Risk Oscillator, 𝐒𝐡𝐨𝐰 𝐑𝐒𝐈 𝐑𝐢𝐬𝐤 𝐎𝐬𝐜𝐢𝐥𝐥𝐚𝐭𝐨𝐫 must be enabled. Disabling this option plots normal RSI Oscillator.
The 4hr chart of BTC-USDT below shows use of RSI Risk Oscillator (Top) with RSI Oscillator (bottom).
===================================================================================================================
╔═══════ 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 ═══════╗
Risk Meter detects both Regular and Hidden Bullish and Bearish Divergences at every occurence. This can be filtered by the use of Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ in above sections. To plot divergences, enable
𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀, Sʜᴏᴡ Rᴇɢᴜʟᴀʀ Dɪᴠᴇʀɢᴇɴᴄᴇs and Sʜᴏᴡ Hɪᴅᴅᴇɴ Dɪᴠᴇʀɢᴇɴᴄᴇs . All divergences are enabled as default.
Users can further filter Divergences by entering the number of bars to the right in Rɪɢʜᴛ ʙᴀʀs ғᴏʀ Pɪᴠᴏᴛ Cᴏɴғɪʀᴍᴀᴛɪᴏɴ input box to confirm the Price Pivot (for Regular divergences) and Oscillator Pivot (for Hidden Divergences).
The example chart of 4hr BTC-USDT chart shows the Divergences filtered by use of RSI Threshold. It is important to note that the trend intensity colour on the plot and bars (if bar colour option is enabled) will help detect if the Divergence would hold.
===================================================================================================================
╔═══════ 𝗨𝘀𝗲𝗳𝘂𝗹 𝗘𝘅𝘁𝗿𝗮𝘀 ═══════╗
Risk Meter offer two vibrant Colour Themes, namely Chilli and Flame , which can be opted from Rɪsᴋ Mᴇᴛᴇʀ Tʜᴇᴍᴇ dropdown. These themes also offer the option to plot the trend intensity on the price bars as bar colours by enabling Rɪsᴋ Mᴇᴛᴇʀ Cᴏʟᴏᴜʀ Bᴀʀs . Bar colors can also be inverted using Iɴᴠᴇʀᴛ Bᴀʀ Cᴏʟᴏᴜʀ option.
Users can also choose to use the Simple theme and choose preferred colours from Sɪᴍᴘʟᴇ Tʜᴇᴍᴇ ʙᴜʟʟ Cᴏʟᴏᴜʀ and Sɪᴍᴘʟᴇ Tʜᴇᴍᴇ ʙᴇᴀʀ Cᴏʟᴏᴜʀ colour input.
Note: The indicator does not repaint and can be confidently used for alerts and trade entries without worrying about plots disappearing after bar close.
===================================================================================================================
Example Charts
1. 89 period Trend Based Stochastic Oscillator as Histogram plot on LINK-USDT 1hr chart with Chilli Theme.
2. 89 period Volatility Risk Oscillator as Histogram plot on SPX 1hr chart with Chilli Theme.
3. 14 period RSI Risk Oscillator as Area plot on AAPL Daily Chart with Flame Theme.
4. 100 period Volatility Risk Oscillator using Trend Strength plotted as Zones on 1hr EUR-USD chart with Chilli Theme.
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
TradeChartist Fib Master™TradeChartist Fib Master is a versatile Fibonacci Support and Resistance indicator that can be used to plot Automatic Levels and Fibonacci Levels based on a variety of ways from the settings, including Auto Fibs plot by connecting to an external indicator.
===================================================================================================================
What does ™TradeChartist Fib Master do?
Plots Automatic Levels without the need for user input
Plots 3 types of Fibonacci Levels
════ 1. Auto-Fibs (by connecting to an external indicator - Oscillatory or non-Oscillatory)
════ 2. Fibs based on Lookback (Lookback type - Candles or Days)
════ 3. Fibs based on Price Input
===================================================================================================================
Detailed description of ™TradeChartist Fib Master features
╔══ Automatic Levels Generator ══╗
Enabling Plot Automatic Levels plots support and resistance levels automatically without any input from the user other than preferred levels plot from the indicator settings namely,
Plot Local Levels for Lower TF - Plots all important Support/Resistance levels for mostly smaller time frames (can be used for up to 1hr in most cases). Recommended for Scalping/Swing Trading mostly dependent on volatility.
Plot Local Levels for Higher TF - Plots all important Support/Resistance levels inferred from mostly time frames - Short to Mid term outlook.
Plot Extended Levels for Higher TF - Plots all important Support/Resistance levels inferred from very higher time frames - Mid to Long term outlook.
Use Trading View Data Window to make effective use of the levels.
Tip: Add a duplicate Fib Master indicator to chart, use Automatic Levels Generator and increase transparency of Fib colours to 100. This helps view the levels on Data Window while having the Fib plots on chart.
Note: Uncheck Plot Automatic Levels to enable Fibonacci plots from Fibonacci Levels Generator
╔══ Fibonacci Levels Generator ══╗
════ 1. Auto-Fibs ════
Almost any indicator plot or Signal (Oscillatory or non-Oscillatory) can be connected to Fib Master to generate automatic fib levels. This is done by automatically detecting the price trend based on the connected indicator, its corresponding highest high and lowest low prices of each trend.
Also, Fib Master plots Bull (default - green) and Bear (default - red) Zones background including the signal candle (default - orange), where the trend changes based on the connected indicator Signal. This helps detect the effectiveness of the connected indicator Signal too, as too many unproductive signals from the connected indicator will create numerous Bull and Bear Zones (which also will render the Auto-Fibs ineffective).
To connect an external indicator Signal, just choose the corresponding Signal plot from the Plug Indicator Here dropdown from settings and choose whether the connected signal is Oscillatory (for Oscillators like RSI, CCI, MACD, Trend Identifier signals from more complex indicators like ™TradeChartist Bollinger Bands and Donchian Channels Pro etc.) or non-Oscillatory (for plots like Moving Averages, Super Trend, Ichimoku plots like Kijun Sen etc.)
If the connected Signal is Oscillatory, enter the filter levels. Default is 0 for both fields as most Oscillators have 0 as their mean reversal zone. For Oscillators like RSI, 60/40, 50/50, 55/45 etc. can be used.
Note: Please test the performance and effectiveness of Auto-Fibs of connected Signal first before using it for trades.
════ 2. Fibs based on Lookback ════
Lookback type - Candles
Determines the High and Low price of the user input number of Candles back (100 default) and plots Fibonacci Levels based on the calculated High and Low for the number of candles in the past from the current candle. The levels stay intact on any time frame as long as no new Highs or Lows are formed.
Lookback type - Days
Determines the High and Low price of the user input number of Days back (100 default) and plots Fibonacci Levels based on the calculated High and Low for the number of days in the past from the day of the current bar. The levels stay intact on any time frame as long as no new Highs or Lows are formed.
════ 3. Fibs based on Price Input ════
Plots Fibonacci Levels based on the user specified High and Low Price in the settings input fields. The levels stay intact on any time frame irrespective of new Highs or Lows being formed. Manual Price Input will enable the trader to keep the Levels intact and visually see the higher Fibonacci Retracement levels, when the price crosses beyond 100% retracement. On the other two lookback types, the Fibonacci levels are displayed only upto 100% retracement.
===================================================================================================================
Note: Show Auto-Fibs from current High/Low
When this option is chosen from indicator settings, the Auto-fib levels are drawn from the highest high of the trending price direction to lowest low of last trend for uptrend or vice-versa for downtrend.
===================================================================================================================
Extra Features
The Fibonacci levels can also be reversed by enabling Reverse Fibonacci Levels option from the settings.
0.886 and 1.113 Fib levels can be plotted on chart by enabling Show 0.886 and 1.113 Fibs from settings, as these are important levels for harmonic pattern traders.
Fib Line and Label Style including Color, transparency, size etc. can be changed from settings based on user preference.
===================================================================================================================
Example Charts
XAU-USD Gold Daily chart using Automatic Levels Generator with Zones identified when connected to external indicator
BTC-USDT Daily chart using Automatic Levels Generator
SPX 1hr chart using Automatic Levels Generator
ETH-USDT 1hr chart using AutoFibs generated by connecting Fib Master to RSI with 60/40 Filter levels
XAG-USD (Silver) 1hr chart using Fibonacci Levels based on lookback
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
Momentum Drift Oscillator™TradeChartist Momentum Drift Oscillator is a elegantly designed Oscillator that uses both trend following and mean reversion models, that helps visualize the price momentum, based on user defined lookback period and standard deviation.
===================================================================================================================
Momentum Drift Oscillator ( MDO ) Features:
MDO shows how far away the price is, from the mean, based on Lookback Length (21, 34, 55, 89, 144, 233) and Standard Deviation input (Min - 0.236, Max - 2.0) , and helps understand potential price reversal points based on mean reversion principles.
Drift Visualizer helps visualise the velocity with which Price moves and helps the trader spot various momentum drift zones like Fuel zones, Overbought/Oversold areas and Bull/Bear Exhaustion limits. Drift Visualizer above 150 is usually Overbought and value above 200 is Super Overbought. Similarly, value below -150 is usually Oversold and value below -200 is Super Oversold.
Option to enable and disable coloured bars based on Momentum Drift. (Colour intensity on Price bars helps visualise the price momentum - 2 Colour Schemes available from the settings - Chilli and Flame).
Long and Short Trade Alerts can be created using Once Per Bar Close .
The indicator does not repaint. Alerts may display potential repaint warning, but this is because the code uses bar index for Drift Visualizer labels. For confidence in the indicator, it can be tested using bar replay to make sure the real-time and bar replay trade entries and plots stay on the same bar/timestamp.
MDO can be connected to ™TradeChartist Plug and Trade to generate Trade Entries, Targets, Sop Loss plots etc and to create all types of alerts.
===================================================================================================================
Why is Momentum Drift Oscillator ( MDO ) different from traditional Momentum based indicators?
This Momentum Drift model truly combines mean reversion and trend following principles, but with a unique original idea.
It needs 2 user defined inputs - Lookback length and Standard Deviation. If for example, say the trend is Bullish and MDO is above 0, the Oscillator doesn't go below 0, even if there is extreme bull exhaustion, if the trend based on lookback and standard deviation is not favorable to reverse trades.
Only Fibonacci lookback periods (21, 34, 55, 89, 144, 233) are used as they have been found more effective than other periods. The default Lookback period is 55 and Standard Deviation is 1, but this can be changed from the settings. Lower values of Lookback period go well with higher Standard Deviation and higher values of Lookback period go well with lower Standard Deviation (0.5, 0.618, 0.786, 0.886, 1 etc.), based on trading style and personal risk strategy.
The indicator includes a Drift Visualizer that helps spot important trade zones based on Price Velocity, calculated dynamically for every bar based on user defined parameters. The first move above or below 0 always opens at Bull Fuel or Bear Fuel zone and the exhaustion zones are reached only at the time of price returning to the mean. But it doesn't change direction if the trend is still up, so the trader can make an informed decision as to when to reverse trades, based on another confirmator.
Similarly, when the Visualizer reaches Fuel or Support/Resistance zones, it normally needs a bit of a push to reach the Overbought - Super Overbought/Oversold - Super Oversold levels where the price normally starts reversing back to the mean and this whole process can be visualized through Visualizer labels on MDO. This process eliminates a lot of noise that normally comes with traditional Momentum indicators.
===================================================================================================================
Example Charts:
1. XAU-USD 1hr chart - Lookback - 55, Std Dev - 2
2. ADA-USDT 4hr chart - Lookback - 89, Std Dev - 1
3. WTI - USOIL Daily chart - Lookback - 34, Std Dev - 1.618
4. SPX Daily chart - Lookback - 144, Std Dev - 0.236
5. GBP-USD 15m chart - Lookback - 144, Std Dev - 0.618
6. BTC-USD 1hr connected to Plug and Trade - Lookback - 55, Std Dev - 1
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
TradeChartist Range Bands ™TradeChartist Range Bands is an exceptionally well designed Entry/Exit indicator that plots fluid Range Bands and dynamic Support/Resistance levels on chart, along with trade entries by using both trend following and mean reversion principles.
===================================================================================================================
How does ™TradeChartist Range Bands work?
The Indicator plots Range Bands with Upper, Lower and Mean, calculated using trading models that use both Trend Following and Mean Reversion principles . It is the Range Bands that decide the trade Entries as the breakouts above upper band generates long entries and the breakouts below the lower band generates the short entries.
The Range Bands Type (Automatic, Aggressive or Normal) can be chosen from the settings. Default is Automatic and it uses Aggressive for non 24 hr markets and Normal for 24 hr markets like Cryptocurrencies.
The width of the Range Bands can be changed using the Range Multiplier from the settings. Default is 1.618 , minimum value is 0.618 and maximum value is 2.0.
The frequency of the Trade Signals depends on both Range Bands type and Range Multiplier. So it is worth spending some time to test the indicator based on these 2 factors on the asset traded, to maximise the profit potential by optimising the type and multiplier value.
In addition to the Range Bands, the indicator also plots Dynamic Support and Resistance bands that are more sensitive to price action and helps the user determine growing support/resistance which is indicated by coloured dots. These dots normally appear when the Support or Resistance stays at the same level for a few bars.
The expansion and contraction of the Support and Resistance bands also help in visualising the price volatility, and an extremely narrow squeeze of these levels within the Range Bands normally signals a lucrative market move. This is usually followed by a breakout from the bands and will be signalled by the Trade Entry plots (BUY and SELL).
The Dynamic Support and Resistance levels can be enabled or disabled from the settings. The fill between these dynamic levels helps the user to visualise the Bull and Bear strength/power. This fill can also be disabled from the settings if not required.
The indicator has a nice Fibonacci levels generator companion that helps spot near support and resistance levels using Fibonacci Retracement tool.
There are 3 types of Fib plots that can be chosen from the settings - Auto-Fibs, Fibs based on Lookback, Fibs based on Price Input .
The Auto-Fibs feature is used as default and it automatically plots fib retracement based on nearby significant high/low (highest from previous up and down trends). This is normally based on nearby trade entries too. Occasionally, during choppy markets/sideways movement, the range of these levels can be quite small and if close price exceeds the 4.618 fib level, one of the other Fib plot options can be used. Alternatively, Plot fibs from current high/low can also be used.
Fibs based on lookback can be used by choosing the number of candles or days lookback to help the indicator automatically find the high and low of the period to generate fib levels. Similarly, Fibs based on price input requires, user to manually enter the high and low price points for the indicator to generate fib levels based on user input.
The indicator has two colour schemes for the Dynamic Support/Resistance fill and bar colours. The coloured bars and the fill will help visualise the price trend. This can be changed or disabled from the settings.
The Fib levels can be disabled by unchecking lines and labels from the styles tab of indicator settings.
Long and Short entry Alerts can be created by using Once Per Bar Close .
The indicator does not repaint. Alerts may display potential repaint warning, but this is because the code uses bar index for fib labels. For confidence in the indicator, it can be tested using bar replay to make sure the real-time and bar replay trade entries and plots stay on the same bar/timestamp.
The different elements of the indicator are shown below in the chart.
===================================================================================================================
™TradeChartist Range Bands can also be connected to ™TradeChartist Plug and Trade to generate Targets, Stop Loss Plot etc. and other alerts can also be created. Use Range Bands Trend Identifier to connect as an Oscillatory Signal to Plug and Trade. Example chart shown below.
===================================================================================================================
Example charts:
1. ADA-USDT 4hr chart using Aggressive type and 1.618 Range Multiplier
2. ADA-USDT 4hr chart using Normal type and 1.618 Range Multiplier
3. XAU-USD 15m chart using Normal type and 1.618 Range Multiplier - Fibs based on 3 days lookback
4. DJI 4hr chart using Normal type and 2.0 Range Multiplier
5. GBP-USD 15m chart using Normal type and 1.618 Range Multiplier
6. LINK-USDT 1hr chart using Normal type and 1.236 Range Multiplier
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
TradeChartist Transformer ™TradeChartist Transformer is an extremely useful indicator that transforms any indicator plot, Oscillatory or Non-Oscillatory into Support/Resistance levels, thereby generating trade entries on Price chart.
How does ™TradeChartist Transformer work?
1. Connect any external indicator plot to Transformer by choosing it from the Transformer's Plug Indicator Here dropdown from the settings.
2. Choose whether the connected plot is Oscillatory or Non-Oscillatory from Indicator Type .
3. If connected indicator is an oscillator, enter the values for Transformer to generate Trade Entries. For example, if the connected Indicator is RSI, user can define RSI level 60 for BUY entries and RSI level 40 for SELL entries. For most oscillators, the value is 0 which is the default value.
4. There are two types of Trade Entries, one based on Fail/breach of Nearby Support/Resistance and the other based on Fail/breach of Ultimate Support/Resistance plotted by Transformer. For Higher Time-Frames like Daily, Fail/breach of Nearby S/R entry type will ensure early trade entries. This could vary from indicator to indicator and a thorough testing/observation on timeframe traded using paper trades is highly recommended before trading with real money.
5. Once Steps 1-4 are complete, BUY and SELL plots based on above will be plotted by Transformer on Price chart.
6. BUY and SELL plots are also decided by an ATR (Average True Range) condition + Indicator plot acting as filter itself along with fail/breach of Support/Resistance, as this helps minimise unproductive trade signals.
7. Enabling Dynamic Support/Resistance plots moving Support/Resistance levels for each bar. For most assets/timeframes, this doesn't alter the Trade entries.
8. Bar Colors and Profit Taking Bars can be enables from settings as these help identify the trend visually and also help recommend bars where profit taking is recommended.
9. Alerts can be created for Long and Short entries by using Once Per Bar Close as Alert Frequency. Entries are generated on Real time bars as close price fails Support or breaches Resistance. It is recommended to wait for bar close before taking a position based on Transformer Trade Entries.
10. Trade Entries or Transformer plots don't repaint. This can be verified using Bar Replay by confirming real time plots with historical plots. Also, when creating alerts, there will be no Alert Warning for repainting as the code doesn't use Security function or other functions that cause potential repainting.
===================================================================================================================
™TradeChartist Transformer can also be connected to ™TradeChartist Plug and Trade to generate Targets, Stop Loss Plot etc. and other alerts can also be created. Example chart shown below - Transformer connected to RSI to generate BUYs when RSI > 60 and SELLs when RSI < 40, connected to Plug and Trade.
===================================================================================================================
Example Charts:
1. CCI - (CCI>100 - Bullish and CCI<-100 - Bearish) connected to Transformer - BTC 1hr chart
2. Chaikin Money Flow with default values connected to Transformer - BTC 1hr chart
3. EMA connected to Transformer- BTC Daily chart
4. Awesome Oscillator connected to Transformer - GBPUSD Daily Chart
5. Ichimoku Cloud Conversion Line connected to Transformer - USOIL 1hr chart
===================================================================================================================
Best Practice: Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
TradeChartist TrendStalker - Market Bias Indicator™TradeChartist TrendStalker helps visualise the Market Bias through 3 different Plot types and also displays Trend Direction Identifier (Green, Red and Orange square blocks) that can be connected to ™TradeChartist Plug and Trade to generate Trade entries, Targets, StopLoss and create alerts based on performance on the chosen timeframe. The three plot types are as below.
1. Market Bias Strength Oscillator
Plots true strength of Market Bias - helps determine if Market is Bullish/Bearish overall for the asset on chart TF.
2. Market Bias Detector - Range Based
Displays TrendStalker plots stalking the Market Bias based on Range the Market is expecting to gain/lose from the asset on the Chart Timeframe. Change in Market Bias can be easily seen through the Convergence/Divergence of the TrendStalker plots.
3. Market Bias Detector - Price
Displays TrendStalker plots stalking the Market Bias based on Price for the asset on the Chart Timeframe. Change in Market Bias can be easily seen through the Convergence/Divergence of the TrendStalker plots.
Note: Trend Direction Identifier for Trade entries will be the same for Market Bias Detector plots, but differs from Market Bias Strength Oscillator.
Note: Trend Direction Identifier plots orange squares when its detecting a potential change in trend and its recommended to close some/most of the position or move Stop Loss to protect profit/reduce risk. Once the orange squares turn back into green/red squares, it signals safe re-entry.
Green squares - Bullish Trend
Red Squares - Bearish Trend
Orange Squares - Potential change in Market Bias
===================================================================================================================
TrendStalker Cool Extras
Option to paint Background Color
Option to enable Take Profit bar recommendation (Works only with Market Bias Strength Oscillator)
Option to paint Price Bars using Market Bias Strength
Alerts can be created for Long/Short Entry/Re-entry and Long/Short SOS signals (Orange squares). For all other alerts, ™TradeChartist Plug and Trade can be used.
BTC 1hr Chart with TrendStalker Extras
===================================================================================================================
BTC 1hr Chart with TrendStalker connected to ™TradeChartist Plug and Trade
===================================================================================================================
This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
Bar Balance [LucF]Bar Balance extracts the number of up, down and neutral intrabars contained in each chart bar, revealing information on the strength of price movement. It can display stacked columns representing raw up/down/neutral intrabar counts, or an up/down balance line which can be calculated and visualized in many different ways.
WARNING: This is an analysis tool that works on historical bars only. It does not show any realtime information, and thus cannot be used to issue alerts or for automated trading. When realtime bars elapse, the indicator will require a browser refresh, a change to its Inputs or to the chart's timeframe/symbol to recalculate and display information on those elapsed bars. Once a trader understands this, the indicator can be used advantageously to make discretionary trading decisions.
Traders used to work with my Delta Volume Columns Pro will feel right at home in this indicator's Inputs . It has lots of options, allowing it to be used in many different ways. If you value the bar balance information this indicator mines, I hope you will find the time required to master the use of Bar Balance well worth the investment.
█ OVERVIEW
The indicator has two modes: Columns and Line .
Columns
• In Columns mode you can display stacked Up/Down/Neutral columns.
• The "Up" section represents the count of intrabars where `close > open`, "Down" where `close < open` and "Neutral" where `close = open`.
• The Up section always appears above the centerline, the Down section below. The Neutral section overlaps the centerline, split halfway above and below it.
The Up and Down sections start where the Neutral section ends, when there is one.
• The Up and Down sections can be colored independently using 7 different methods.
• The signal line plotted in Line mode can also be displayed in Columns mode.
Line
• Displays a single balance line using a zero centerline.
• A variable number of independent methods can be used to calculate the line (6), determine its color (5), and color the fill (5).
You can thus evaluate the state of 3 different components with this single line.
• A "Divergence Levels" feature will use the line to automatically draw expanding levels on divergence events.
Features available in both modes
• The color of all components can be selected from 15 base colors, with 16 gradient levels used for each base color in the indicator's gradients.
• A zero line can show a 6-state aggregate value of the three main volume balance modes.
• The background can be colored using any of 5 different methods.
• Chart bars can be colored using 5 different methods.
• Divergence and large neutral count ratio events can be shown in either Columns or Line mode, calculated in one of 4 different methods.
• Markers on 6 different conditions can be displayed.
█ CONCEPTS
Intrabar inspection
Intrabar inspection means the indicator looks at lower timeframe bars ( intrabars ) making up a given chart bar to gather its information. If your chart is on a 1-hour timeframe and the intrabar resolution determined by the indicator is 5 minutes, then 12 intrabars will be analyzed for each chart bar and the count of up/down/neutral intrabars among those will be tallied.
Bar Balances and calculation methods
The indicator uses a variety of methods to evaluate bar balance and to derive other calculations from them:
1. Balance on Bar : Uses the relative importance of instant Up and Down counts on the bar.
2. Balance Averages : Uses the difference between the EMAs of Up and Down counts.
3. Balance Momentum : Starts by calculating, separately for both Up and Down counts, the difference between the same EMAs used in Balance Averages and an SMA of double the period used for the EMAs. These differences are then aggregated and finally, a bounded momentum of that aggregate is calculated using RSI.
4. Markers Bias : It sums the bull/bear occurrences of the four previous markers over a user-defined period (the default is 14).
5. Combined Balances : This is the aggregate of the instant bull/bear bias of the three main bar balances.
6. Dual Up/Down Averages : This is a display mode showing the EMA calculated for each of the Up and Down counts.
Interpretation of neutral intrabars
What do neutral intrabars mean? When price does not change during a bar, it can be because there is simply no interest in the market, or because of a perfect balance between buyers and sellers. The latter being more improbable, Bar Balance assumes that neutral bars reveal a lack of interest, which entails uncertainty. That is the reason why the option is provided to interpret ratios of neutral intrabars greater than 50% as divergences. It is also the rationale behind the option to dampen signal lines on the inverse ratio of neutral intrabars, so that zero intrabars do not affect the signal, and progressively larger proportions of neutral intrabars will reduce the signal's amplitude, as the balance calcs using the up/down counts lose significance. The impact of the dampening will vary with markets. Weaker markets such as cryptos will often contain greater numbers of neutral intrabars, so dampening the Line in that sector will have a greater impact than in more liquid markets.
█ FEATURES
1 — Columns
• While the size of the Up/Down columns always represents their respective importance on the bar, their coloring mode is independent. The default setup uses a standard coloring mode where the Up/Down columns over/under the zero line are always in the bull/bear color with a higher intensity for the winning side. Six other coloring modes allow you to pack more information in the columns. When choosing to color the top columns using a bull/bear gradient on Balance Averages, for example, you will end up with bull/bear colored tops. In order for the color of the bottom columns to continue to show the instant bar balance, you can then choose the "Up/Down Ratio on Bar — Dual Solid Colors" coloring mode to make those bars the color of the winning side for that bar.
• Line mode shows only the line, but Columns mode allows displaying the line along with it. If the scale of the line is different than that of the scale of the columns, the line will often appear flat. Traders may find even a flat line useful as its bull/bear colors will be easily distinguishable.
2 — Line
• The default setup for Line mode uses a calculation on "Balance Momentum", with a fill on the longer-term "Balance Averages" and a line color based on the "Markers Bias". With the background set on "Line vs Divergence Levels" and the zero line on the hard-coded "Combined Bar Balances", you have access to five distinct sources of information at a glance, to which you can add divergences, divergences levels and chart bar coloring. This provides powerful potential in displaying bar balance information.
• When no columns are displayed, Line mode can show the full scale of whichever line you choose to calculate because the columns' scale no longer interferes with the line's scale.
• Note that when "Balance on Bar" is selected, the Neutral count is also displayed as a ratio of the balance line. This is the only instance where the Neutral count is displayed in Line mode.
• The "Dual Up/Down Averages" is an exception as it displays two lines: one average for the Up counts and another for the Down counts. This mode will be most useful when Columns are also displayed, as it provides a reference for the top and bottom columns.
3 — Zero Line
The zero line can be colored using two methods, both based on the Combined Balances, i.e., the aggregate of the instant bull/bear bias of the three main bar balances.
• In "Six-state Dual Color Gradient" mode, a dot appears on every bar. Its color reflects the bull/bear state of the Combined Balances, and the dot's brightness reflects the tally of balance biases.
• In "Dual Solid Colors (All Bull/All Bear Only)" a dot only appears when all three balances are either bullish or bearish. The resulting pattern is identical to that of Marker 1.
4 — Divergences
• Divergences are displayed as a small circle at the top of the scale. Four different types of divergence events can be detected. Divergences occur whenever the bull/bear bias of the method used diverges with the bar's price direction.
• An option allows you to include in divergence events instances where the count of neutral intrabars exceeds 50% of the total intrabar count.
• The divergence levels are dynamic levels that automatically build from the line's values on divergence events. On consecutive divergences, the levels will expand, creating a channel. This implementation of the divergence levels corresponds to my view that divergences indicate anomalies, hesitations, points of uncertainty if you will. It excludes any association of a pre-determined bullish/bearish bias to divergences. Accordingly, the levels merely take note of divergence events and mark those points in time with levels. Traders then have a reference point from which they can evaluate further movement. The bull/bear/neutral colors used to plot the levels are also congruent with this view in that they are determined by price's position relative to the levels, which is how I think divergences can be put to the most effective use.
5 — Background
• The background can show a bull/bear gradient on four different calculations. You can adjust its brightness to make its visual importance proportional to how you use it in your analysis.
6 — Chart bars
• Chart bars can be colored using five different methods.
• You have the option of emptying the body of bars where volume does not increase, as does my TLD indicator, the idea behind this being that movement on bars where volume does not increase is less relevant.
7 — Intrabar Resolution
You can choose between three modes. Two of them are automatic and one is manual:
a) Fast, Longer history, Auto-Steps (~12 intrabars) : Optimized for speed and deeper history. Uses an average minimum of 12 intrabars.
b) More Precise, Shorter History Auto-Steps (~24 intrabars) : Uses finer intrabar resolution. It is slower and provides less history. Uses an average minimum of 24 intrabars.
c) Fixed : Uses the fixed resolution of your choice.
Auto-Steps calculations vary for 24/7 and conventional markets in order to achieve the proper target of minimum intrabars.
You can choose to view the intrabar resolution currently used to calculate delta volume. It is the default.
The proper selection of the intrabar resolution is important. It must achieve maximal granularity to produce precise results while not unduly slowing down calculations, or worse, causing runtime errors.
8 — Markers
Six markers are available:
1. Combined Balances Agreement : All three Bar Balances are either bullish or bearish.
2. Up or Down % Agrees With Bar : An up marker will appear when the percentage of up intrabars in an up chart bar is greater than the specified percentage. Conditions mirror to down bars.
3. Divergence confirmations By Price : One of the four types of balance calculations can be used to detect divergences with price. Confirmations occur when the bar following the divergence confirms the balance bias. Note that the divergence events used here do not include neutral intrabar events.
4. Balance Transitions : Bull/bear transitions of the selected balance.
5. Markers Bias Transitions : Bull/bear transitions of the Markers Bias.
6. Divergence Confirmations By Line : Marks points where the line first breaches a divergence level.
Markers appear when the condition is detected, without delay. Since nothing is plotted in realtime, markers do not appear on the realtime bar.
9 — Settings
• Two modes can be selected to dampen the line on the ratio of neutral intrabars.
• A distinct weight can be attributed to the count of the latter half of intrabars, on the assumption that later intrabars may be more important in determining the outcome of chart bars.
• Allows control over the periods of the different moving averages used in calculations.
• The default periods used for the various calculations define the following hierarchy from slow to fast:
Balance Averages: 50,
Balance Momentum: 20,
Dual Up/Down Averages: 20,
Marker Bias: 10.
█ LIMITATIONS
• This script uses a special characteristic of the `security()` function allowing the inspection of intrabars—which is not officially supported by TradingView.
• The method used does not work on the realtime bar—only on historical bars.
• The indicator only works on some chart resolutions: 3, 5, 10, 15 and 30 minutes, 1, 2, 4, 6, and 12 hours, 1 day, 1 week and 1 month. The script’s code can be modified to run on other resolutions, but chart resolutions must be divisible by the lower resolution used for intrabars and the stepping mechanism could require adaptation.
• When using the "Line vs Divergence Levels — Dual Color Gradient" color mode to fill the line, background or chart bars, keep in mind that a line calculation mode must be defined for it to work, as it determines gradients on the movement of the line relative to divergence levels. If the line is hidden, it will not work.
• When the difference between the chart’s resolution and the intrabar resolution is too great, runtime errors will occur. The Auto-Steps selection mechanisms should avoid this.
• Alerts do not work reliably when `security()` is used at intrabar resolutions. Accordingly, no alerts are configured in the indicator.
• The color model used in the indicator provides for fancy visuals that come at a price; when you change values in Inputs , it can take 20 seconds for the changes to materialize. Luckily, once your color setup is complete, the color model does not have a large performance impact, as in normal operation the `security()` calls will become the most important factor in determining response time. Also, once in a while a runtime error will occur when you change inputs. Just making another change will usually bring the indicator back up.
█ RAMBLINGS
Is this thing useful?
I'll let you decide. Bar Balance acts somewhat like an X-Ray on bars. The intrabars it analyzes are no secret; one can simply change the chart's resolution to see the same intrabars the indicator uses. What the indicator brings to traders is the precise count of up/down/neutral intrabars and, more importantly, the calculations it derives from them to present the information in a way that can make it easier to use in trading decisions.
How reliable is Bar Balance information?
By the same token that an up bar does not guarantee that more up bars will follow, future price movements cannot be inferred from the mere count of up/down/neutral intrabars. Price movement during any chart bar for which, let's say, 12 intrabars are analyzed, could be due to only one of those intrabars. One can thus easily see how only relying on bar balance information could be very misleading. The rationale behind Bar Balance is that when the information mined for multiple chart bars is aggregated, it can provide insight into the history behind chart bars, and thus some bias as to the strength of movements. An up chart bar where 11/12 intrabars are also up is assumed to be stronger than the same up bar where only 2/12 intrabars are up. This logic is not bulletproof, and sometimes Bar Balance will stray. Also, keep in mind that balance lines do not represent price momentum as RSI would. Bar Balance calculations have no idea where price is. Their perspective, like that of any historian, is very limited, constrained that it is to the narrow universe of up/down/neutral intrabar counts. You will thus see instances where price is moving up while Balance Momentum, for example, is moving down. When Bar Balance performs as intended, this indicates that the rally is weakening, which does necessarily imply that price will reverse. Occasionally, price will merrily continue to advance on weakening strength.
Divergences
Most of the divergence detection methods used here rely on a difference between the bias of a calculation involving a multi-bar average and a given bar's price direction. When using "Bar Balance on Bar" however, only the bar's balance and price movement are used. This is the default mode.
As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. I do not share the overwhelming enthusiasm traders have for the purported ability of bullish/bearish divergences to indicate imminent reversals.
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . Bar Balance can display lots of information. While learning to use a new indicator inevitably requires an adaptation period where we put it through its paces and try out all its options, once you have become used to Bar Balance and decide to adopt it, rigorously eliminate the components you don't use and configure the remaining ones so their visual prominence reflects their relative importance in your analysis. I tried to provide flexible options for traders to control this indicator's visuals for that exact reason—not for window dressing.
█ NOTES
For traders
• To avoid misleading traders who don't read script descriptions, the indicator shows nothing in the realtime bar.
• The Data Window shows key values for the indicator.
• All gradients used in this indicator determine their brightness intensities using advances/declines in the signal—not their relative position in a fixed scale.
• Note that because of the way gradients are optimized internally, changing their brightness will sometimes require bringing down the value a few steps before you see an impact.
• Because this indicator does not use volume, it will work on all markets.
For coders
• For those interested in gradients, this script uses an advanced version of the Advance/Decline gradient function from the PineCoders Color Gradient (16 colors) Framework . It allows more precise control over the range, steps and min/max values of the gradients.
• I use the PineCoders Coding Conventions for Pine to write my scripts.
• I used functions modified from the PineCoders MTF Selection Framework for the selection of timeframes.
█ THANKS TO:
— alexgrover who helped me think through the dampening method used to attenuate signal lines on high ratios of neutral intrabars.
— A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator . The technique I use to inspect intrabars is derived from Kuan's code.
— theheirophant , my partner in the exploration of the sometimes weird abysses of `security()`’s behavior at intrabar resolutions.
— midtownsk8rguy , my brilliant companion in mining the depths of Pine graphics. He is also the co-author of the PineCoders Color Gradient Frameworks .
TradeChartist MTF RSI Spotter™TradeChartist MTF RSI Spotter is an elegant Multi Timeframe RSI tool that helps spot price trends using visually engaging and appealing RSI plots and backgrounds compared to the basic RSI plot. Also the Bull and the Bear background fills + HTF RSI based background fills are highly useful for traders who like to visually understand areas of entry and exit based on RSI .
What does ™TradeChartist MTF RSI Spotter do?
Plots RSI with visually spottable colors for Bull and Bear zones (Green and Red) with optional background fill.
Plots RMA based on User specified length.
Plots user preferred HTF RSI on same chart as chart TF - HTF resolution from indicator settings drop-down must be used.
Fills Bull and Bear zone colors based on HTF based RSI movement.
Spots Regular RSI Bullish and Bearish Divergences.
Plots RSI color candles on main chart based on Upper and Lower RSI band.
Plots RSI based on RSI smoothing (1 for Regular RSI without smoothing) and Heikin Ashi RSI if opted from indicator settings.
This indicator works like a dream when used with other indicators for confirmation of Trends.
Note 1: Divergences don't work to trader's expectations all the time. It is a great indicator but has to be used with caution and entries must be confirmed using another indicator like Volume , Trend, fundamentals, market sentiment etc. They can't be used on their own to decide entry and exit.
Note 2: Bull and Bear RMA with chart TF RSI should be used for confirmation and not as a standalone indicator for entry and exit.
Example charts
Premium Scripts - Trial access and Information
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
Backtesting & Trading Engine [PineCoders]The PineCoders Backtesting and Trading Engine is a sophisticated framework with hybrid code that can run as a study to generate alerts for automated or discretionary trading while simultaneously providing backtest results. It can also easily be converted to a TradingView strategy in order to run TV backtesting. The Engine comes with many built-in strats for entries, filters, stops and exits, but you can also add you own.
If, like any self-respecting strategy modeler should, you spend a reasonable amount of time constantly researching new strategies and tinkering, our hope is that the Engine will become your inseparable go-to tool to test the validity of your creations, as once your tests are conclusive, you will be able to run this code as a study to generate the alerts required to put it in real-world use, whether for discretionary trading or to interface with an execution bot/app. You may also find the backtesting results the Engine produces in study mode enough for your needs and spend most of your time there, only occasionally converting to strategy mode in order to backtest using TV backtesting.
As you will quickly grasp when you bring up this script’s Settings, this is a complex tool. While you will be able to see results very quickly by just putting it on a chart and using its built-in strategies, in order to reap the full benefits of the PineCoders Engine, you will need to invest the time required to understand the subtleties involved in putting all its potential into play.
Disclaimer: use the Engine at your own risk.
Before we delve in more detail, here’s a bird’s eye view of the Engine’s features:
More than 40 built-in strategies,
Customizable components,
Coupling with your own external indicator,
Simple conversion from Study to Strategy modes,
Post-Exit analysis to search for alternate trade outcomes,
Use of the Data Window to show detailed bar by bar trade information and global statistics, including some not provided by TV backtesting,
Plotting of reminders and generation of alerts on in-trade events.
By combining your own strats to the built-in strats supplied with the Engine, and then tuning the numerous options and parameters in the Inputs dialog box, you will be able to play what-if scenarios from an infinite number of permutations.
USE CASES
You have written an indicator that provides an entry strat but it’s missing other components like a filter and a stop strategy. You add a plot in your indicator that respects the Engine’s External Signal Protocol, connect it to the Engine by simply selecting your indicator’s plot name in the Engine’s Settings/Inputs and then run tests on different combinations of entry stops, in-trade stops and profit taking strats to find out which one produces the best results with your entry strat.
You are building a complex strategy that you will want to run as an indicator generating alerts to be sent to a third-party execution bot. You insert your code in the Engine’s modules and leverage its trade management code to quickly move your strategy into production.
You have many different filters and want to explore results using them separately or in combination. Integrate the filter code in the Engine and run through different permutations or hook up your filtering through the external input and control your filter combos from your indicator.
You are tweaking the parameters of your entry, filter or stop strat. You integrate it in the Engine and evaluate its performance using the Engine’s statistics.
You always wondered what results a random entry strat would yield on your markets. You use the Engine’s built-in random entry strat and test it using different combinations of filters, stop and exit strats.
You want to evaluate the impact of fees and slippage on your strategy. You use the Engine’s inputs to play with different values and get immediate feedback in the detailed numbers provided in the Data Window.
You just want to inspect the individual trades your strategy generates. You include it in the Engine and then inspect trades visually on your charts, looking at the numbers in the Data Window as you move your cursor around.
You have never written a production-grade strategy and you want to learn how. Inspect the code in the Engine; you will find essential components typical of what is being used in actual trading systems.
You have run your system for a while and have compiled actual slippage information and your broker/exchange has updated his fees schedule. You enter the information in the Engine and run it on your markets to see the impact this has on your results.
FEATURES
Before going into the detail of the Inputs and the Data Window numbers, here’s a more detailed overview of the Engine’s features.
Built-in strats
The engine comes with more than 40 pre-coded strategies for the following standard system components:
Entries,
Filters,
Entry stops,
2 stage in-trade stops with kick-in rules,
Pyramiding rules,
Hard exits.
While some of the filter and stop strats provided may be useful in production-quality systems, you will not devise crazy profit-generating systems using only the entry strats supplied; that part is still up to you, as will be finding the elusive combination of components that makes winning systems. The Engine will, however, provide you with a solid foundation where all the trade management nitty-gritty is handled for you. By binding your custom strats to the Engine, you will be able to build reliable systems of the best quality currently allowed on the TV platform.
On-chart trade information
As you move over the bars in a trade, you will see trade numbers in the Data Window change at each bar. The engine calculates the P&L at every bar, including slippage and fees that would be incurred were the trade exited at that bar’s close. If the trade includes pyramided entries, those will be taken into account as well, although for those, final fees and slippage are only calculated at the trade’s exit.
You can also see on-chart markers for the entry level, stop positions, in-trade special events and entries/exits (you will want to disable these when using the Engine in strategy mode to see TV backtesting results).
Customization
You can couple your own strats to the Engine in two ways:
1. By inserting your own code in the Engine’s different modules. The modular design should enable you to do so with minimal effort by following the instructions in the code.
2. By linking an external indicator to the engine. After making the proper selections in the engine’s Settings and providing values respecting the engine’s protocol, your external indicator can, when the Engine is used in Indicator mode only:
Tell the engine when to enter long or short trades, but let the engine’s in-trade stop and exit strats manage the exits,
Signal both entries and exits,
Provide an entry stop along with your entry signal,
Filter other entry signals generated by any of the engine’s entry strats.
Conversion from strategy to study
TradingView strategies are required to backtest using the TradingView backtesting feature, but if you want to generate alerts with your script, whether for automated trading or just to trigger alerts that you will use in discretionary trading, your code has to run as a study since, for the time being, strategies can’t generate alerts. From hereon we will use indicator as a synonym for study.
Unless you want to maintain two code bases, you will need hybrid code that easily flips between strategy and indicator modes, and your code will need to restrict its use of strategy() calls and their arguments if it’s going to be able to run both as an indicator and a strategy using the same trade logic. That’s one of the benefits of using this Engine. Once you will have entered your own strats in the Engine, it will be a matter of commenting/uncommenting only four lines of code to flip between indicator and strategy modes in a matter of seconds.
Additionally, even when running in Indicator mode, the Engine will still provide you with precious numbers on your individual trades and global results, some of which are not available with normal TradingView backtesting.
Post-Exit Analysis for alternate outcomes (PEA)
While typical backtesting shows results of trade outcomes, PEA focuses on what could have happened after the exit. The intention is to help traders get an idea of the opportunity/risk in the bars following the trade in order to evaluate if their exit strategies are too aggressive or conservative.
After a trade is exited, the Engine’s PEA module continues analyzing outcomes for a user-defined quantity of bars. It identifies the maximum opportunity and risk available in that space, and calculates the drawdown required to reach the highest opportunity level post-exit, while recording the number of bars to that point.
Typically, if you can’t find opportunity greater than 1X past your trade using a few different reasonable lengths of PEA, your strategy is doing pretty good at capturing opportunity. Remember that 100% of opportunity is never capturable. If, however, PEA was finding post-trade maximum opportunity of 3 or 4X with average drawdowns of 0.3 to those areas, this could be a clue revealing your system is exiting trades prematurely. To analyze PEA numbers, you can uncomment complete sets of plots in the Plot module to reveal detailed global and individual PEA numbers.
Statistics
The Engine provides stats on your trades that TV backtesting does not provide, such as:
Average Profitability Per Trade (APPT), aka statistical expectancy, a crucial value.
APPT per bar,
Average stop size,
Traded volume .
It also shows you on a trade-by-trade basis, on-going individual trade results and data.
In-trade events
In-trade events can plot reminders and trigger alerts when they occur. The built-in events are:
Price approaching stop,
Possible tops/bottoms,
Large stop movement (for discretionary trading where stop is moved manually),
Large price movements.
Slippage and Fees
Even when running in indicator mode, the Engine allows for slippage and fees to be included in the logic and test results.
Alerts
The alert creation mechanism allows you to configure alerts on any combination of the normal or pyramided entries, exits and in-trade events.
Backtesting results
A few words on the numbers calculated in the Engine. Priority is given to numbers not shown in TV backtesting, as you can readily convert the script to a strategy if you need them.
We have chosen to focus on numbers expressing results relative to X (the trade’s risk) rather than in absolute currency numbers or in other more conventional but less useful ways. For example, most of the individual trade results are not shown in percentages, as this unit of measure is often less meaningful than those expressed in units of risk (X). A trade that closes with a +25% result, for example, is a poor outcome if it was entered with a -50% stop. Expressed in X, this trade’s P&L becomes 0.5, which provides much better insight into the trade’s outcome. A trade that closes with a P&L of +2X has earned twice the risk incurred upon entry, which would represent a pre-trade risk:reward ratio of 2.
The way to go about it when you think in X’s and that you adopt the sound risk management policy to risk a fixed percentage of your account on each trade is to equate a currency value to a unit of X. E.g. your account is 10K USD and you decide you will risk a maximum of 1% of it on each trade. That means your unit of X for each trade is worth 100 USD. If your APPT is 2X, this means every time you risk 100 USD in a trade, you can expect to make, on average, 200 USD.
By presenting results this way, we hope that the Engine’s statistics will appeal to those cognisant of sound risk management strategies, while gently leading traders who aren’t, towards them.
We trade to turn in tangible profits of course, so at some point currency must come into play. Accordingly, some values such as equity, P&L, slippage and fees are expressed in currency.
Many of the usual numbers shown in TV backtests are nonetheless available, but they have been commented out in the Engine’s Plot module.
Position sizing and risk management
All good system designers understand that optimal risk management is at the very heart of all winning strategies. The risk in a trade is defined by the fraction of current equity represented by the amplitude of the stop, so in order to manage risk optimally on each trade, position size should adjust to the stop’s amplitude. Systems that enter trades with a fixed stop amplitude can get away with calculating position size as a fixed percentage of current equity. In the context of a test run where equity varies, what represents a fixed amount of risk translates into different currency values.
Dynamically adjusting position size throughout a system’s life is optimal in many ways. First, as position sizing will vary with current equity, it reproduces a behavioral pattern common to experienced traders, who will dial down risk when confronted to poor performance and increase it when performance improves. Second, limiting risk confers more predictability to statistical test results. Third, position sizing isn’t just about managing risk, it’s also about maximizing opportunity. By using the maximum leverage (no reference to trading on margin here) into the trade that your risk management strategy allows, a dynamic position size allows you to capture maximal opportunity.
To calculate position sizes using the fixed risk method, we use the following formula: Position = Account * MaxRisk% / Stop% [, which calculates a position size taking into account the trade’s entry stop so that if the trade is stopped out, 100 USD will be lost. For someone who manages risk this way, common instructions to invest a certain percentage of your account in a position are simply worthless, as they do not take into account the risk incurred in the trade.
The Engine lets you select either the fixed risk or fixed percentage of equity position sizing methods. The closest thing to dynamic position sizing that can currently be done with alerts is to use a bot that allows syntax to specify position size as a percentage of equity which, while being dynamic in the sense that it will adapt to current equity when the trade is entered, does not allow us to modulate position size using the stop’s amplitude. Changes to alerts are on the way which should solve this problem.
In order for you to simulate performance with the constraint of fixed position sizing, the Engine also offers a third, less preferable option, where position size is defined as a fixed percentage of initial capital so that it is constant throughout the test and will thus represent a varying proportion of current equity.
Let’s recap. The three position sizing methods the Engine offers are:
1. By specifying the maximum percentage of risk to incur on your remaining equity, so the Engine will dynamically adjust position size for each trade so that, combining the stop’s amplitude with position size will yield a fixed percentage of risk incurred on current equity,
2. By specifying a fixed percentage of remaining equity. Note that unless your system has a fixed stop at entry, this method will not provide maximal risk control, as risk will vary with the amplitude of the stop for every trade. This method, as the first, does however have the advantage of automatically adjusting position size to equity. It is the Engine’s default method because it has an equivalent in TV backtesting, so when flipping between indicator and strategy mode, test results will more or less correspond.
3. By specifying a fixed percentage of the Initial Capital. While this is the least preferable method, it nonetheless reflects the reality confronted by most system designers on TradingView today. In this case, risk varies both because the fixed position size in initial capital currency represents a varying percentage of remaining equity, and because the trade’s stop amplitude may vary, adding another variability vector to risk.
Note that the Engine cannot display equity results for strategies entering trades for a fixed amount of shares/contracts at a variable price.
SETTINGS/INPUTS
Because the initial text first published with a script cannot be edited later and because there are just too many options, the Engine’s Inputs will not be covered in minute detail, as they will most certainly evolve. We will go over them with broad strokes; you should be able to figure the rest out. If you have questions, just ask them here or in the PineCoders Telegram group.
Display
The display header’s checkbox does nothing.
For the moment, only one exit strategy uses a take profit level, so only that one will show information when checking “Show Take Profit Level”.
Entries
You can activate two simultaneous entry strats, each selected from the same set of strats contained in the Engine. If you select two and they fire simultaneously, the main strat’s signal will be used.
The random strat in each list uses a different seed, so you will get different results from each.
The “Filter transitions” and “Filter states” strats delegate signal generation to the selected filter(s). “Filter transitions” signals will only fire when the filter transitions into bull/bear state, so after a trade is stopped out, the next entry may take some time to trigger if the filter’s state does not change quickly. When you choose “Filter states”, then a new trade will be entered immediately after an exit in the direction the filter allows.
If you select “External Indicator”, your indicator will need to generate a +2/-2 (or a positive/negative stop value) to enter a long/short position, providing the selected filters allow for it. If you wish to use the Engine’s capacity to also derive the entry stop level from your indicator’s signal, then you must explicitly choose this option in the Entry Stops section.
Filters
You can activate as many filters as you wish; they are additive. The “Maximum stop allowed on entry” is an important component of proper risk management. If your system has an average 3% stop size and you need to trade using fixed position sizes because of alert/execution bot limitations, you must use this filter because if your system was to enter a trade with a 15% stop, that trade would incur 5 times the normal risk, and its result would account for an abnormally high proportion in your system’s performance.
Remember that any filter can also be used as an entry signal, either when it changes states, or whenever no trade is active and the filter is in a bull or bear mode.
Entry Stops
An entry stop must be selected in the Engine, as it requires a stop level before the in-trade stop is calculated. Until the selected in-trade stop strat generates a stop that comes closer to price than the entry stop (or respects another one of the in-trade stops kick in strats), the entry stop level is used.
It is here that you must select “External Indicator” if your indicator supplies a +price/-price value to be used as the entry stop. A +price is expected for a long entry and a -price value will enter a short with a stop at price. Note that the price is the absolute price, not an offset to the current price level.
In-Trade Stops
The Engine comes with many built-in in-trade stop strats. Note that some of them share the “Length” and “Multiple” field, so when you swap between them, be sure that the length and multiple in use correspond to what you want for that stop strat. Suggested defaults appear with the name of each strat in the dropdown.
In addition to the strat you wish to use, you must also determine when it kicks in to replace the initial entry’s stop, which is determined using different strats. For strats where you can define a positive or negative multiple of X, percentage or fixed value for a kick-in strat, a positive value is above the trade’s entry fill and a negative one below. A value of zero represents breakeven.
Pyramiding
What you specify in this section are the rules that allow pyramiding to happen. By themselves, these rules will not generate pyramiding entries. For those to happen, entry signals must be issued by one of the active entry strats, and conform to the pyramiding rules which act as a filter for them. The “Filter must allow entry” selection must be chosen if you want the usual system’s filters to act as additional filtering criteria for your pyramided entries.
Hard Exits
You can choose from a variety of hard exit strats. Hard exits are exit strategies which signal trade exits on specific events, as opposed to price breaching a stop level in In-Trade Stops strategies. They are self-explanatory. The last one labelled When Take Profit Level (multiple of X) is reached is the only one that uses a level, but contrary to stops, it is above price and while it is relative because it is expressed as a multiple of X, it does not move during the trade. This is the level called Take Profit that is show when the “Show Take Profit Level” checkbox is checked in the Display section.
While stops focus on managing risk, hard exit strategies try to put the emphasis on capturing opportunity.
Slippage
You can define it as a percentage or a fixed value, with different settings for entries and exits. The entry and exit markers on the chart show the impact of slippage on the entry price (the fill).
Fees
Fees, whether expressed as a percentage of position size in and out of the trade or as a fixed value per in and out, are in the same units of currency as the capital defined in the Position Sizing section. Fees being deducted from your Capital, they do not have an impact on the chart marker positions.
In-Trade Events
These events will only trigger during trades. They can be helpful to act as reminders for traders using the Engine as assistance to discretionary trading.
Post-Exit Analysis
It is normally on. Some of its results will show in the Global Numbers section of the Data Window. Only a few of the statistics generated are shown; many more are available, but commented out in the Plot module.
Date Range Filtering
Note that you don’t have to change the dates to enable/diable filtering. When you are done with a specific date range, just uncheck “Date Range Filtering” to disable date filtering.
Alert Triggers
Each selection corresponds to one condition. Conditions can be combined into a single alert as you please. Just be sure you have selected the ones you want to trigger the alert before you create the alert. For example, if you trade in both directions and you want a single alert to trigger on both types of exits, you must select both “Long Exit” and “Short Exit” before creating your alert.
Once the alert is triggered, these settings no longer have relevance as they have been saved with the alert.
When viewing charts where an alert has just triggered, if your alert triggers on more than one condition, you will need the appropriate markers active on your chart to figure out which condition triggered the alert, since plotting of markers is independent of alert management.
Position sizing
You have 3 options to determine position size:
1. Proportional to Stop -> Variable, with a cap on size.
2. Percentage of equity -> Variable.
3. Percentage of Initial Capital -> Fixed.
External Indicator
This is where you connect your indicator’s plot that will generate the signals the Engine will act upon. Remember this only works in Indicator mode.
DATA WINDOW INFORMATION
The top part of the window contains global numbers while the individual trade information appears in the bottom part. The different types of units used to express values are:
curr: denotes the currency used in the Position Sizing section of Inputs for the Initial Capital value.
quote: denotes quote currency, i.e. the value the instrument is expressed in, or the right side of the market pair (USD in EURUSD ).
X: the stop’s amplitude, itself expressed in quote currency, which we use to express a trade’s P&L, so that a trade with P&L=2X has made twice the stop’s amplitude in profit. This is sometimes referred to as R, since it represents one unit of risk. It is also the unit of measure used in the APPT, which denotes expected reward per unit of risk.
X%: is also the stop’s amplitude, but expressed as a percentage of the Entry Fill.
The numbers appearing in the Data Window are all prefixed:
“ALL:” the number is the average for all first entries and pyramided entries.
”1ST:” the number is for first entries only.
”PYR:” the number is for pyramided entries only.
”PEA:” the number is for Post-Exit Analyses
Global Numbers
Numbers in this section represent the results of all trades up to the cursor on the chart.
Average Profitability Per Trade (X): This value is the most important gauge of your strat’s worthiness. It represents the returns that can be expected from your strat for each unit of risk incurred. E.g.: your APPT is 2.0, thus for every unit of currency you invest in a trade, you can on average expect to obtain 2 after the trade. APPT is also referred to as “statistical expectancy”. If it is negative, your strategy is losing, even if your win rate is very good (it means your winning trades aren’t winning enough, or your losing trades lose too much, or both). Its counterpart in currency is also shown, as is the APPT/bar, which can be a useful gauge in deciding between rivalling systems.
Profit Factor: Gross of winning trades/Gross of losing trades. Strategy is profitable when >1. Not as useful as the APPT because it doesn’t take into account the win rate and the average win/loss per trade. It is calculated from the total winning/losing results of this particular backtest and has less predictive value than the APPT. A good profit factor together with a poor APPT means you just found a chart where your system outperformed. Relying too much on the profit factor is a bit like a poker player who would think going all in with two’s against aces is optimal because he just won a hand that way.
Win Rate: Percentage of winning trades out of all trades. Taken alone, it doesn’t have much to do with strategy profitability. You can have a win rate of 99% but if that one trade in 100 ruins you because of poor risk management, 99% doesn’t look so good anymore. This number speaks more of the system’s profile than its worthiness. Still, it can be useful to gauge if the system fits your personality. It can also be useful to traders intending to sell their systems, as low win rate systems are more difficult to sell and require more handholding of worried customers.
Equity (curr): This the sum of initial capital and the P&L of your system’s trades, including fees and slippage.
Return on Capital is the equivalent of TV’s Net Profit figure, i.e. the variation on your initial capital.
Maximum drawdown is the maximal drawdown from the highest equity point until the drop . There is also a close to close (meaning it doesn’t take into account in-trade variations) maximum drawdown value commented out in the code.
The next values are self-explanatory, until:
PYR: Avg Profitability Per Entry (X): this is the APPT for all pyramided entries.
PEA: Avg Max Opp . Available (X): the average maximal opportunity found in the Post-Exit Analyses.
PEA: Avg Drawdown to Max Opp . (X): this represents the maximum drawdown (incurred from the close at the beginning of the PEA analysis) required to reach the maximal opportunity point.
Trade Information
Numbers in this section concern only the current trade under the cursor. Most of them are self-explanatory. Use the description’s prefix to determine what the values applies to.
PYR: Avg Profitability Per Entry (X): While this value includes the impact of all current pyramided entries (and only those) and updates when you move your cursor around, P&L only reflects fees at the trade’s last bar.
PEA: Max Opp . Available (X): It’s the most profitable close reached post-trade, measured from the trade’s Exit Fill, expressed in the X value of the trade the PEA follows.
PEA: Drawdown to Max Opp . (X): This is the maximum drawdown from the trade’s Exit Fill that needs to be sustained in order to reach the maximum opportunity point, also expressed in X. Note that PEA numbers do not include slippage and fees.
EXTERNAL SIGNAL PROTOCOL
Only one external indicator can be connected to a script; in order to leverage its use to the fullest, the engine provides options to use it as either an entry signal, an entry/exit signal or a filter. When used as an entry signal, you can also use the signal to provide the entry’s stop. Here’s how this works:
For filter state: supply +1 for bull (long entries allowed), -1 for bear (short entries allowed).
For entry signals: supply +2 for long, -2 for short.
For exit signals: supply +3 for exit from long, -3 for exit from short.
To send an entry stop level with an entry signal: Send positive stop level for long entry (e.g. 103.33 to enter a long with a stop at 103.33), negative stop level for short entry (e.g. -103.33 to enter a short with a stop at 103.33). If you use this feature, your indicator will have to check for exact stop levels of 1.0, 2.0 or 3.0 and their negative counterparts, and fudge them with a tick in order to avoid confusion with other signals in the protocol.
Remember that mere generation of the values by your indicator will have no effect until you explicitly allow their use in the appropriate sections of the Engine’s Settings/Inputs.
An example of a script issuing a signal for the Engine is published by PineCoders.
RECOMMENDATIONS TO ASPIRING SYSTEM DESIGNERS
Stick to higher timeframes. On progressively lower timeframes, margins decrease and fees and slippage take a proportionally larger portion of profits, to the point where they can very easily turn a profitable strategy into a losing one. Additionally, your margin for error shrinks as the equilibrium of your system’s profitability becomes more fragile with the tight numbers involved in the shorter time frames. Avoid <1H time frames.
Know and calculate fees and slippage. To avoid market shock, backtest using conservative fees and slippage parameters. Systems rarely show unexpectedly good returns when they are confronted to the markets, so put all chances on your side by being outrageously conservative—or a the very least, realistic. Test results that do not include fees and slippage are worthless. Slippage is there for a reason, and that’s because our interventions in the market change the market. It is easier to find alpha in illiquid markets such as cryptos because not many large players participate in them. If your backtesting results are based on moving large positions and you don’t also add the inevitable slippage that will occur when you enter/exit thin markets, your backtesting will produce unrealistic results. Even if you do include large slippage in your settings, the Engine can only do so much as it will not let slippage push fills past the high or low of the entry bar, but the gap may be much larger in illiquid markets.
Never test and optimize your system on the same dataset , as that is the perfect recipe for overfitting or data dredging, which is trying to find one precise set of rules/parameters that works only on one dataset. These setups are the most fragile and often get destroyed when they meet the real world.
Try to find datasets yielding more than 100 trades. Less than that and results are not as reliable.
Consider all backtesting results with suspicion. If you never entertained sceptic tendencies, now is the time to begin. If your backtest results look really good, assume they are flawed, either because of your methodology, the data you’re using or the software doing the testing. Always assume the worse and learn proper backtesting techniques such as monte carlo simulations and walk forward analysis to avoid the traps and biases that unchecked greed will set for you. If you are not familiar with concepts such as survivor bias, lookahead bias and confirmation bias, learn about them.
Stick to simple bars or candles when designing systems. Other types of bars often do not yield reliable results, whether by design (Heikin Ashi) or because of the way they are implemented on TV (Renko bars).
Know that you don’t know and use that knowledge to learn more about systems and how to properly test them, about your biases, and about yourself.
Manage risk first , then capture opportunity.
Respect the inherent uncertainty of the future. Cleanse yourself of the sad arrogance and unchecked greed common to newcomers to trading. Strive for rationality. Respect the fact that while backtest results may look promising, there is no guarantee they will repeat in the future (there is actually a high probability they won’t!), because the future is fundamentally unknowable. If you develop a system that looks promising, don’t oversell it to others whose greed may lead them to entertain unreasonable expectations.
Have a plan. Understand what king of trading system you are trying to build. Have a clear picture or where entries, exits and other important levels will be in the sort of trade you are trying to create with your system. This stated direction will help you discard more efficiently many of the inevitably useless ideas that will pop up during system design.
Be wary of complexity. Experienced systems engineers understand how rapidly complexity builds when you assemble components together—however simple each one may be. The more complex your system, the more difficult it will be to manage.
Play! . Allow yourself time to play around when you design your systems. While much comes about from working with a purpose, great ideas sometimes come out of just trying things with no set goal, when you are stuck and don’t know how to move ahead. Have fun!
@LucF
NOTES
While the engine’s code can supply multiple consecutive entries of longs or shorts in order to scale positions (pyramid), all exits currently assume the execution bot will exit the totality of the position. No partial exits are currently possible with the Engine.
Because the Engine is literally crippled by the limitations on the number of plots a script can output on TV; it can only show a fraction of all the information it calculates in the Data Window. You will find in the Plot Module vast amounts of commented out lines that you can activate if you also disable an equivalent number of other plots. This may be useful to explore certain characteristics of your system in more detail.
When backtesting using the TV backtesting feature, you will need to provide the strategy parameters you wish to use through either Settings/Properties or by changing the default values in the code’s header. These values are defined in variables and used not only in the strategy() statement, but also as defaults in the Engine’s relevant Inputs.
If you want to test using pyramiding, then both the strategy’s Setting/Properties and the Engine’s Settings/Inputs need to allow pyramiding.
If you find any bugs in the Engine, please let us know.
THANKS
To @glaz for allowing the use of his unpublished MA Squize in the filters.
To @everget for his Chandelier stop code, which is also used as a filter in the Engine.
To @RicardoSantos for his pseudo-random generator, and because it’s from him that I first read in the Pine chat about the idea of using an external indicator as input into another. In the PineCoders group, @theheirophant then mentioned the idea of using it as a buy/sell signal and @simpelyfe showed a piece of code implementing the idea. That’s the tortuous story behind the use of the external indicator in the Engine.
To @admin for the Volatility stop’s original code and for the donchian function lifted from Ichimoku .
To @BobHoward21 for the v3 version of Volatility Stop .
To @scarf and @midtownsk8rguy for the color tuning.
To many other scripters who provided encouragement and suggestions for improvement during the long process of writing and testing this piece of code.
To J. Welles Wilder Jr. for ATR, used extensively throughout the Engine.
To TradingView for graciously making an account available to PineCoders.
And finally, to all fellow PineCoders for the constant intellectual stimulation; it is a privilege to share ideas with you all. The Engine is for all TradingView PineCoders, of course—but especially for you.
Look first. Then leap.
TraderDemircan - Ultimate Fibonacci Suite (Bearish) v2.0-Overview
This indicator is a comprehensive Fibonacci-based trading tool specifically designed for identifying and trading bearish XABCD harmonic patterns. It combines classical Fibonacci retracement/extension levels with advanced harmonic pattern recognition, risk management calculations, and confluence zone detection to provide traders with a complete analytical framework for short positions.
-What Makes This Script Original
Unlike standard Fibonacci tools that simply draw static levels, this script:
Dynamically identifies swing highs and lows using lookback period analysis
Automatically detects and labels XABCD formation points (X, A, B, C, D) in real-time
Recognizes multiple harmonic patterns (Gartley, Butterfly, Bat, Crab, Shark) with customizable tolerance
Calculates and displays Potential Reversal Zones (PRZ) at point D
Provides integrated risk management with position sizing, stop loss, and multiple take profit levels
Identifies confluence zones where multiple Fibonacci levels intersect
Includes trend filter to validate pattern direction
Offers trading mode presets for scalpers, day traders, and swing traders
-How It Works
XABCD Pattern Detection (Bearish Version)
The script uses a bearish structure where:
Point X: The highest point (swing high) identified within the lookback period
Point A: The lowest point (swing low) that occurs after X
Point B: The retracement level from A back toward X (typically 0.382, 0.5, 0.618, or 0.786)
Point C: The projected target below B (calculated as B minus the X-A range)
Point D: The Potential Reversal Zone (PRZ) where the short position is recommended
The algorithm:
Scans the last N bars (user-defined) to find the highest point (X)
Identifies the lowest point after X (point A)
Monitors price retracement to determine point B
Projects point C and D targets based on Fibonacci extensions
Validates the formation against minimum swing size requirements
Optionally applies trend filter to confirm bearish bias
Fibonacci Levels
The script plots 14 customizable Fibonacci levels:
Retracement levels: 0.0 (X), 0.236, 0.382, 0.5, 0.618, 0.786, 1.0 (A)
Extension levels: 1.272, 1.414, 1.618, 2.0, 2.618, 3.618, 4.236
Each level is color-coded and can be individually toggled on/off. In the bearish version, these levels are calculated from the swing high (X) downward to the swing low (A) and beyond.
Harmonic Pattern Recognition
The indicator automatically detects five classic harmonic patterns when enabled:
Bearish Gartley (75% probability): B retracement at 0.618, D target at 0.786
Bearish Butterfly (70% probability): B retracement at 0.786, D target at 1.272
Bearish Bat (80% probability): B retracement at 0.382-0.5, D target at 0.886
Bearish Crab (85% probability): B retracement at 0.382-0.618, D target at 1.618
Bearish Shark (72% probability): B retracement at 0.382-0.618, D target at 1.13
Pattern detection uses a tolerance parameter (default 5%) to account for market imperfections. When a pattern is identified, it displays the pattern name and estimated success probability.
Risk Management System
The script includes a complete risk management framework:
Position Sizing: Calculates the appropriate position size based on:
Account size (user input)
Risk percentage per trade (user input)
Distance from entry to stop loss
Stop Loss: Automatically placed 0.5% above point X to protect against invalidation
Take Profit Levels:
TP1: 1.272 extension (customizable)
TP2: 1.618 extension (customizable)
TP3: 2.0 extension (customizable)
Risk/Reward Ratio: Displayed in the info panel, calculated as (Entry - TP3) / (Stop Loss - Entry)
Confluence Detection
When multiple Fibonacci levels converge within 0.5% of each other, the script highlights these zones with translucent boxes. These confluence zones often act as strong support/resistance areas and increase the probability of reversal.
Minimum confluence threshold is customizable (default: 2 levels).
Trend Filter
Optional moving average filter (default: 50-period SMA) helps validate that patterns are forming in the direction of the prevailing trend. When enabled with "Only Show Patterns in Trend Direction," the indicator will only display formations that align with a bearish trend (price below MA).
-How to Use
For Scalpers:
Select "Scalper" trading mode
Use lower timeframes (1m, 5m, 15m)
Focus on TP1 and TP2 levels
Tight stop loss above point X
For Day Traders:
Select "Day Trader" trading mode
Use medium timeframes (15m, 30m, 1H)
Target TP2 and TP3 levels
Monitor confluence zones for entry refinement
For Swing Traders:
Select "Swing Trader" trading mode
Use higher timeframes (4H, D)
Hold for TP3 or beyond
Use trend filter to confirm macro direction
Entry Strategy:
Wait for point D (PRZ) to be reached
Look for bearish confirmation (candlestick patterns, volume, momentum)
Enter short position at or near point D
Place stop loss above point X as indicated
Scale out at TP1, TP2, and TP3 levels
-Key Settings
General Settings:
Trading Mode: Presets optimized for different trading styles
Lookback Bars: Historical period for swing detection (10-200)
Min Swing Size: Minimum percentage move to validate formation (0.1-10%)
Fibonacci Levels:
Individual toggle and color customization for all 14 levels
Line thickness and style options (Solid/Dashed/Dotted)
Optional price and percentage labels
Left and right line extension
Harmonic Patterns:
Enable/disable specific pattern types
Pattern tolerance adjustment (1-15%)
Risk Management:
Account size input
Risk percentage per trade (0.5-10%)
Customizable TP level multipliers
Toggle stop loss and take profit displays
Display Options:
Show/hide XABCD lines
C target and D target (PRZ) visualization
Confluence zone highlights
Trend MA overlay
Information panel with trade statistics
Alert Settings:
Pattern completion alerts
C target hit notifications
Key Fibonacci level alerts
-Visual Features
Color-coded Fibonacci levels: Each level has a distinct color for easy identification
Dynamic XABCD lines: Yellow lines connect pattern formation points
Target projections: Magenta for C target, blue for D target (PRZ)
Risk management lines: Red for stop loss, green for take profits
Confluence boxes: Golden translucent boxes highlight key zones
Information panel: Top-right panel displays pattern type, entry, stop loss, TP3, R:R ratio, position size, and direction
Point labels: Clear X, A, B, C, D markers with hover tooltips showing exact prices
-Important Disclaimers
Risk Warning: Trading financial instruments involves substantial risk and may not be suitable for all investors. Past performance of any trading system or pattern is not necessarily indicative of future results.
No Repainting: This indicator does NOT repaint. All pattern detection and level calculations are based on confirmed price data at the close of each bar.
Backtesting Note: If used as a strategy with backtesting, ensure realistic parameters:
Use appropriate commission (0.1% or higher for most markets)
Include slippage (10+ ticks for liquid markets)
Risk no more than 2-5% of account per trade
Test on sufficient sample size (100+ trades minimum)
Manual Confirmation: This indicator is a tool to assist analysis, not a complete trading system. Always use additional confirmation from:
Price action analysis
Volume confirmation
Market context and news
Risk tolerance assessment
Harmonic Pattern Probabilities: The success rates shown (70-85%) are theoretical estimates based on historical studies and should not be interpreted as guarantees. Actual results will vary based on market conditions, execution timing, and individual risk management.
-Technical Details
Pine Script Version: v6 (latest)
Overlay: True (displays on price chart)
Maximum Objects: 500 lines, 500 labels, 500 boxes
Calculation Method: Swing high/low detection with percentage-based Fibonacci calculations
No Lookahead Bias: All calculations use confirmed historical data
Compatible Timeframes: All timeframes (1m to 1M), recommended 15m and above
-Differences from Bullish Version
This is the bearish version specifically designed for short positions:
X point is the swing HIGH (not low)
A point is the swing LOW (not high)
B retracement moves UP from A toward X
C target projects DOWN from B
D target (PRZ) is calculated ABOVE X for short entries
All Fibonacci levels are inverted for downward price movement
Pattern recognition logic adjusted for bearish structures
A companion bullish version is available separately for long position analysis.
RSI Profile [Kodexius]RSI Profile is an advanced technical indicator that turns the classic RSI into a distribution profile instead of a single oscillating line. Rather than only showing where the RSI is at the current bar, it displays where the RSI has spent most of its time or most of its volume over a user defined lookback period.
The script builds a histogram of RSI values between 0 and 100, splits that range into configurable bins, and then projects the result to the right side of the chart. This gives you a clear visual representation of the RSI structure, including the Point of Control (POC), the Value Area High (VAH), and the Value Area Low (VAL). The POC marks the RSI level with the highest activity, while VAH and VAL bracket the percentage based value area around it.
By combining standard RSI, a distribution profile, and value area logic, this tool lets you study RSI behavior statistically instead of only bar by bar. You can immediately see whether the current RSI reading is located inside the dominant zone, extended above it, or depressed below it, and whether the recent regime has been biased toward overbought, oversold, or neutral territory. This is particularly useful for swing traders, mean reversion systems, and anyone who wants to integrate RSI context into a more profile oriented workflow.
🔹 Features
1. RSI-Based Distribution Profile
-Builds a histogram of RSI values between 0 and 100.
-The RSI range is divided into a user-defined number of bins (e.g., 30 bins).
-Each bin represents a band of RSI values, such as 0–3.33, 3.33–6.66, ..., 96.66–100.
-For each bar in the lookback period, the script:
-Finds which bin the RSI value belongs to
Adds either:
-1.0 → if using time/frequency
-volume → if using volume-weighted RSI distribution
This creates a clear profile of where RSI has been concentrated over the chosen lookback window.
2. Time / Volume Weighting Mode
Under Profile Settings, you can choose:
-Weight by Volume = false
→ Profile is built using time spent at each RSI level (frequency).
-Weight by Volume = true
→ Profile is built using volume traded at each RSI level.
This flexibility allows you to decide whether you want:
-A pure momentum structure (time spent at each RSI)
-Or a participation-weighted structure (where higher-volume zones are emphasized)
3. Configurable Lookback & Resolution
-Profile Lookback: number of historical bars to analyze.
-Number of Bins: controls the resolution of the histogram:
Fewer bins → smoother, fewer gaps
More bins → more detail, but potentially more visual sparsity
-Profile Width (Bars): defines how wide the histogram extends into the future (visually), converted into time using average bar duration.
This provides a balance between performance, clarity, and visual density.
4. Value Area, POC, VAH, VAL
The script computes:
-POC (Point of Control)
→ The RSI bin with the highest total value (time or volume).
-Value Area (VA)
→ The range of RSI bins that contain a user-specified percentage of total activity (e.g., 70%).
-VAH & VAL
→ Upper and lower RSI boundaries of this Value Area.
These are then drawn as horizontal lines and labeled:
-POC line and label
-VAH line and label
-VAL line and label
This gives you a profile-style view similar to classical volume profile, but entirely on the RSI axis.
5. Color Coding & Visual Design
The histogram bars (boxes) are colored using a smart scheme:
-Below 30 RSI → Oversold zone, uses the Oversold Color (default: green).
-Above 70 RSI → Overbought zone, uses the Overbought Color (default: red).
-Between 30 and 70 RSI → Neutral zone, uses a gradient between:
A soft blue at lower mid levels
A soft orange at higher mid levels
Additional styling:
-POC bin is highlighted in bright yellow.
-Bins inside the Value Area → lower transparency (more solid).
-Bins outside the Value Area → higher transparency (faded).
This makes it easy to visually distinguish:
-Core RSI activity (VA)
-Extremes (oversold/overbought)
-The single dominant zone (POC)
🔹 Calculations
This section summarizes the core logic behind the script and highlights the main building blocks that power the profile.
1. Profile Structure and Bin Initialization
A custom Profile type groups together configuration, bins and drawing objects. During initialization, the script splits the 0 to 100 RSI range into evenly spaced bins, each represented by a Bin record:
method initBins(Profile p) =>
p.bins := array.new()
float step = 100.0 / p.binCount
for i = 0 to p.binCount - 1
float low = i * step
float high = (i + 1) * step
p.bins.push(Bin.new(low, high, 0.0, box(na)))
2. Filling the Profile Over the Lookback Window
On the last bar, the script clears previous drawings and walks backward through the selected lookback window. For each historical bar, it reads the RSI and volume series and feeds them into the profile:
if barstate.islast
myProfile.reset()
int start = math.max(0, bar_index - lookback)
int end = bar_index
for i = 0 to (end - start)
float r = rsi
float v = volume
if not na(r)
myProfile.add(r, v)
The add method converts each RSI value into a bin index and accumulates either a frequency count or the bar volume, depending on the chosen mode:
method add(Profile p, float rsiValue, float volumeValue) =>
int idx = int(rsiValue / (100.0 / p.binCount))
if idx >= p.binCount
idx := p.binCount - 1
if idx < 0
idx := 0
Bin targetBin = p.bins.get(idx)
float addedValue = p.useVolume ? volumeValue : 1.0
targetBin.value += addedValue
3. Finding POC and Building the Value Area
Inside the draw method, the script first scans all bins to determine the maximum value and the total sum. The bin with the highest value becomes the POC. The value area is then constructed by expanding from that center bin until the desired percentage of total activity is covered:
for in p.bins
totalVal += b.value
if b.value > maxVal
maxVal := b.value
pocIdx := i
float vaTarget = totalVal * (p.vaPercent / 100.0)
float currentVaVol = maxVal
int upIdx = pocIdx
int downIdx = pocIdx
while currentVaVol < vaTarget
float upVol = (upIdx < p.binCount - 1) ? p.bins.get(upIdx + 1).value : 0.0
float downVol = (downIdx > 0) ? p.bins.get(downIdx - 1).value : 0.0
if upVol == 0 and downVol == 0
break
if upVol >= downVol
upIdx += 1
currentVaVol += upVol
else
downIdx -= 1
currentVaVol += downVol
CME Bitcoin Weekend Gap (Global) @jerikooDescription:
The Problem: You are watching the wrong hours. Many traders assume CME Bitcoin futures follow standard stock market hours or open Monday morning. This is incorrect.
Stock Market: Opens Monday morning.
CME Bitcoin: Opens Sunday Evening (US Time).
If you are in Europe, this means the market actually opens at Midnight (00:00) Monday. If you are waiting for the "Monday Morning Open," you are late.
The Solution: True Gap Detection This indicator highlights the exact downtime of the CME Bitcoin Futures market to help you identify true liquidity gaps.
Why this script is different: Most gap scripts break when you change your chart's time zone (e.g., switching from UTC to New York). This script is Universal.
Hardcoded Exchange Time: It calculates logic based on "America/Chicago" (CME HQ) time, regardless of your local chart settings.
Manual Offset Fix: Some data feeds have a +/- 1 or 2-hour sync difference depending on the broker. This script includes a "Hour Shift" setting to manually align the box perfectly to your specific candles.
How to use:
Add to your chart.
Look for the Dark Green highlighted zone.
This zone represents the Weekend Gap (Friday Close to Sunday Open).
Troubleshooting: If the box starts 1-2 hours too early or too late, go to Settings and change the "Hour Shift" value (e.g., -1, +1) until it snaps perfectly to the Friday close candle.
Technical Details:
CME Close: Friday 16:00 CT
CME Open: Sunday 17:00 CT
Color: Dark Green (50% Transparency)
Step 3: Categories & Tags
Select these options in the right-hand menu of the publishing page.
Category: Trend Analysis OR Bitcoin
Tags: CME Bitcoin BTC Gap Futures Weekend
Step 4: Final Checklist Before Clicking "Publish"
Load the Code: Make sure the "Manual Fix" version of the code (the last one I gave you) is currently open in the Pine Editor.
Add to Chart: You must click "Add to Chart" so the script is visible on your screen before publishing.
Privacy: Select Public (so others can search for it) or Private (if you only want to share the link).
Visibility: Choose Open (so others can see the code) or Protected (if you want to hide the code, though Open is better for simple scripts like this).
Algorithm Predator - ML-liteAlgorithm Predator - ML-lite
This indicator combines four specialized trading agents with an adaptive multi-armed bandit selection system to identify high-probability trade setups. It is designed for swing and intraday traders who want systematic signal generation based on institutional order flow patterns , momentum exhaustion , liquidity dynamics , and statistical mean reversion .
Core Architecture
Why These Components Are Combined:
The script addresses a fundamental challenge in algorithmic trading: no single detection method works consistently across all market conditions. By deploying four independent agents and using reinforcement learning algorithms to select or blend their outputs, the system adapts to changing market regimes without manual intervention.
The Four Trading Agents
1. Spoofing Detector Agent 🎭
Detects iceberg orders through persistent volume at similar price levels over 5 bars
Identifies spoofing patterns via asymmetric wick analysis (wicks exceeding 60% of bar range with volume >1.8× average)
Monitors order clustering using simplified Hawkes process intensity tracking (exponential decay model)
Signal Logic: Contrarian—fades false breakouts caused by institutional manipulation
Best Markets: Consolidations, institutional trading windows, low-liquidity hours
2. Exhaustion Detector Agent ⚡
Calculates RSI divergence between price movement and momentum indicator over 5-bar window
Detects VWAP exhaustion (price at 2σ bands with declining volume)
Uses VPIN reversals (volume-based toxic flow dissipation) to identify momentum failure
Signal Logic: Counter-trend—enters when momentum extreme shows weakness
Best Markets: Trending markets reaching climax points, over-extended moves
3. Liquidity Void Detector Agent 💧
Measures Bollinger Band squeeze (width <60% of 50-period average)
Identifies stop hunts via 20-bar high/low penetration with immediate reversal and volume spike
Detects hidden liquidity absorption (volume >2× average with range <0.3× ATR)
Signal Logic: Breakout anticipation—enters after liquidity grab but before main move
Best Markets: Range-bound pre-breakout, volatility compression zones
4. Mean Reversion Agent 📊
Calculates price z-scores relative to 50-period SMA and standard deviation (triggers at ±2σ)
Implements Ornstein-Uhlenbeck process scoring (mean-reverting stochastic model)
Uses entropy analysis to detect algorithmic trading patterns (low entropy <0.25 = high predictability)
Signal Logic: Statistical reversion—enters when price deviates significantly from statistical equilibrium
Best Markets: Range-bound, low-volatility, algorithmically-dominated instruments
Adaptive Selection: Multi-Armed Bandit System
The script implements four reinforcement learning algorithms to dynamically select or blend agents based on performance:
Thompson Sampling (Default - Recommended):
Uses Bayesian inference with beta distributions (tracks alpha/beta parameters per agent)
Balances exploration (trying underused agents) vs. exploitation (using proven winners)
Each agent's win/loss history informs its selection probability
Lite Approximation: Uses pseudo-random sampling from price/volume noise instead of true random number generation
UCB1 (Upper Confidence Bound):
Calculates confidence intervals using: average_reward + sqrt(2 × ln(total_pulls) / agent_pulls)
Deterministic algorithm favoring agents with high uncertainty (potential upside)
More conservative than Thompson Sampling
Epsilon-Greedy:
Exploits best-performing agent (1-ε)% of the time
Explores randomly ε% of the time (default 10%, configurable 1-50%)
Simple, transparent, easily tuned via epsilon parameter
Gradient Bandit:
Uses softmax probability distribution over agent preference weights
Updates weights via gradient ascent based on rewards
Best for Blend mode where all agents contribute
Selection Modes:
Switch Mode: Uses only the selected agent's signal (clean, decisive)
Blend Mode: Combines all agents using exponentially weighted confidence scores controlled by temperature parameter (smooth, diversified)
Lock Agent Feature:
Optional manual override to force one specific agent
Useful after identifying which agent dominates your specific instrument
Only applies in Switch mode
Four choices: Spoofing Detector, Exhaustion Detector, Liquidity Void, Mean Reversion
Memory System
Dual-Layer Architecture:
Short-Term Memory: Stores last 20 trade outcomes per agent (configurable 10-50)
Long-Term Memory: Stores episode averages when short-term reaches transfer threshold (configurable 5-20 bars)
Memory Boost Mechanism: Recent performance modulates agent scores by up to ±20%
Episode Transfer: When an agent accumulates sufficient results, averages are condensed into long-term storage
Persistence: Manual restoration of learned parameters via input fields (alpha, beta, weights, microstructure thresholds)
How Memory Works:
Agent generates signal → outcome tracked after 8 bars (performance horizon)
Result stored in short-term memory (win = 1.0, loss = 0.0)
Short-term average influences agent's future scores (positive feedback loop)
After threshold met (default 10 results), episode averaged into long-term storage
Long-term patterns (weighted 30%) + short-term patterns (weighted 70%) = total memory boost
Market Microstructure Analysis
These advanced metrics quantify institutional order flow dynamics:
Order Flow Toxicity (Simplified VPIN):
Measures buy/sell volume imbalance over 20 bars: |buy_vol - sell_vol| / (buy_vol + sell_vol)
Detects informed trading activity (institutional players with non-public information)
Values >0.4 indicate "toxic flow" (informed traders active)
Lite Approximation: Uses simple open/close heuristic instead of tick-by-tick trade classification
Price Impact Analysis (Simplified Kyle's Lambda):
Measures market impact efficiency: |price_change_10| / sqrt(volume_sum_10)
Low values = large orders with minimal price impact ( stealth accumulation )
High values = retail-dominated moves with high slippage
Lite Approximation: Uses simplified denominator instead of regression-based signed order flow
Market Randomness (Entropy Analysis):
Counts unique price changes over 20 bars / 20
Measures market predictability
High entropy (>0.6) = human-driven, chaotic price action
Low entropy (<0.25) = algorithmic trading dominance (predictable patterns)
Lite Approximation: Simple ratio instead of true Shannon entropy H(X) = -Σ p(x)·log₂(p(x))
Order Clustering (Simplified Hawkes Process):
Tracks self-exciting event intensity (coordinated order activity)
Decays at 0.9× per bar, spikes +1.0 when volume >1.5× average
High intensity (>0.7) indicates clustering (potential spoofing/accumulation)
Lite Approximation: Simple exponential decay instead of full λ(t) = μ + Σ α·exp(-β(t-tᵢ)) with MLE
Signal Generation Process
Multi-Stage Validation:
Stage 1: Agent Scoring
Each agent calculates internal score based on its detection criteria
Scores must exceed agent-specific threshold (adjusted by sensitivity multiplier)
Agent outputs: Signal direction (+1/-1/0) and Confidence level (0.0-1.0)
Stage 2: Memory Boost
Agent scores multiplied by memory boost factor (0.8-1.2 based on recent performance)
Successful agents get amplified, failing agents get dampened
Stage 3: Bandit Selection/Blending
If Adaptive Mode ON:
Switch: Bandit selects single best agent, uses only its signal
Blend: All agents combined using softmax-weighted confidence scores
If Adaptive Mode OFF:
Traditional consensus voting with confidence-squared weighting
Signal fires when consensus exceeds threshold (default 70%)
Stage 4: Confirmation Filter
Raw signal must repeat for consecutive bars (default 3, configurable 2-4)
Minimum confidence threshold: 0.25 (25%) enforced regardless of mode
Trend alignment check: Long signals require trend_score ≥ -2, Short signals require trend_score ≤ 2
Stage 5: Cooldown Enforcement
Minimum bars between signals (default 10, configurable 5-15)
Prevents over-trading during choppy conditions
Stage 6: Performance Tracking
After 8 bars (performance horizon), signal outcome evaluated
Win = price moved in signal direction, Loss = price moved against
Results fed back into memory and bandit statistics
Trading Modes (Presets)
Pre-configured parameter sets:
Conservative: 85% consensus, 4 confirmations, 15-bar cooldown
Expected: 60-70% win rate, 3-8 signals/week
Best for: Swing trading, capital preservation, beginners
Balanced: 70% consensus, 3 confirmations, 10-bar cooldown
Expected: 55-65% win rate, 8-15 signals/week
Best for: Day trading, most traders, general use
Aggressive: 60% consensus, 2 confirmations, 5-bar cooldown
Expected: 50-58% win rate, 15-30 signals/week
Best for: Scalping, high-frequency trading, active management
Elite: 75% consensus, 3 confirmations, 12-bar cooldown
Expected: 58-68% win rate, 5-12 signals/week
Best for: Selective trading, high-conviction setups
Adaptive: 65% consensus, 2 confirmations, 8-bar cooldown
Expected: Varies based on learning
Best for: Experienced users leveraging bandit system
How to Use
1. Initial Setup (5 Minutes):
Select Trading Mode matching your style (start with Balanced)
Enable Adaptive Learning (recommended for automatic agent selection)
Choose Thompson Sampling algorithm (best all-around performance)
Keep Microstructure Metrics enabled for liquid instruments (>100k daily volume)
2. Agent Tuning (Optional):
Adjust Agent Sensitivity multipliers (0.5-2.0):
<0.8 = Highly selective (fewer signals, higher quality)
0.9-1.2 = Balanced (recommended starting point)
1.3 = Aggressive (more signals, lower individual quality)
Monitor dashboard for 20-30 signals to identify dominant agent
If one agent consistently outperforms, consider using Lock Agent feature
3. Bandit Configuration (Advanced):
Blend Temperature (0.1-2.0):
0.3 = Sharp decisions (best agent dominates)
0.5 = Balanced (default)
1.0+ = Smooth (equal weighting, democratic)
Memory Decay (0.8-0.99):
0.90 = Fast adaptation (volatile markets)
0.95 = Balanced (most instruments)
0.97+ = Long memory (stable trends)
4. Signal Interpretation:
Green triangle (▲): Long signal confirmed
Red triangle (▼): Short signal confirmed
Dashboard shows:
Active agent (highlighted row with ► marker)
Win rate per agent (green >60%, yellow 40-60%, red <40%)
Confidence bars (█████ = maximum confidence)
Memory size (short-term buffer count)
Colored zones display:
Entry level (current close)
Stop-loss (1.5× ATR)
Take-profit 1 (2.0× ATR)
Take-profit 2 (3.5× ATR)
5. Risk Management:
Never risk >1-2% per signal (use ATR-based stops)
Signals are entry triggers, not complete strategies
Combine with your own market context analysis
Consider fundamental catalysts and news events
Use "Confirming" status to prepare entries (not to enter early)
6. Memory Persistence (Optional):
After 50-100 trades, check Memory Export Panel
Record displayed alpha/beta/weight values for each agent
Record VPIN and Kyle threshold values
Enable "Restore From Memory" and input saved values to continue learning
Useful when switching timeframes or restarting indicator
Visual Components
On-Chart Elements:
Spectral Layers: EMA8 ± 0.5 ATR bands (dynamic support/resistance, colored by trend)
Energy Radiance: Multi-layer glow boxes at signal points (intensity scales with confidence, configurable 1-5 layers)
Probability Cones: Projected price paths with uncertainty wedges (15-bar projection, width = confidence × ATR)
Connection Lines: Links sequential signals (solid = same direction continuation, dotted = reversal)
Kill Zones: Risk/reward boxes showing entry, stop-loss, and dual take-profit targets
Signal Markers: Triangle up/down at validated entry points
Dashboard (Configurable Position & Size):
Regime Indicator: 4-level trend classification (Strong Bull/Bear, Weak Bull/Bear)
Mode Status: Shows active system (Adaptive Blend, Locked Agent, or Consensus)
Agent Performance Table: Real-time win%, confidence, and memory stats
Order Flow Metrics: Toxicity and impact indicators (when microstructure enabled)
Signal Status: Current state (Long/Short/Confirming/Waiting) with confirmation progress
Memory Panel (Configurable Position & Size):
Live Parameter Export: Alpha, beta, and weight values per agent
Adaptive Thresholds: Current VPIN sensitivity and Kyle threshold
Save Reminder: Visual indicator if parameters should be recorded
What Makes This Original
This script's originality lies in three key innovations:
1. Genuine Meta-Learning Framework:
Unlike traditional indicator mashups that simply display multiple signals, this implements authentic reinforcement learning (multi-armed bandits) to learn which detection method works best in current conditions. The Thompson Sampling implementation with beta distribution tracking (alpha for successes, beta for failures) is statistically rigorous and adapts continuously. This is not post-hoc optimization—it's real-time learning.
2. Episodic Memory Architecture with Transfer Learning:
The dual-layer memory system mimics human learning patterns:
Short-term memory captures recent performance (recency bias)
Long-term memory preserves historical patterns (experience)
Automatic transfer mechanism consolidates knowledge
Memory boost creates positive feedback loops (successful strategies become stronger)
This architecture allows the system to adapt without retraining , unlike static ML models that require batch updates.
3. Institutional Microstructure Integration:
Combines retail-focused technical analysis (RSI, Bollinger Bands, VWAP) with institutional-grade microstructure metrics (VPIN, Kyle's Lambda, Hawkes processes) typically found in academic finance literature and professional trading systems, not standard retail platforms. While simplified for Pine Script constraints, these metrics provide insight into informed vs. uninformed trading , a dimension entirely absent from traditional technical analysis.
Mashup Justification:
The four agents are combined specifically for risk diversification across failure modes:
Spoofing Detector: Prevents false breakout losses from manipulation
Exhaustion Detector: Prevents chasing extended trends into reversals
Liquidity Void: Exploits volatility compression (different regime than trending)
Mean Reversion: Provides mathematical anchoring when patterns fail
The bandit system ensures the optimal tool is automatically selected for each market situation, rather than requiring manual interpretation of conflicting signals.
Why "ML-lite"? Simplifications and Approximations
This is the "lite" version due to necessary simplifications for Pine Script execution:
1. Simplified VPIN Calculation:
Academic Implementation: True VPIN uses volume bucketing (fixed-volume bars) and tick-by-tick buy/sell classification via Lee-Ready algorithm or exchange-provided trade direction flags
This Implementation: 20-bar rolling window with simple open/close heuristic (close > open = buy volume)
Impact: May misclassify volume during ranging/choppy markets; works best in directional moves
2. Pseudo-Random Sampling:
Academic Implementation: Thompson Sampling requires true random number generation from beta distributions using inverse transform sampling or acceptance-rejection methods
This Implementation: Deterministic pseudo-randomness derived from price and volume decimal digits: (close × 100 - floor(close × 100)) + (volume % 100) / 100
Impact: Not cryptographically random; may have subtle biases in specific price ranges; provides sufficient variation for agent selection
3. Hawkes Process Approximation:
Academic Implementation: Full Hawkes process uses maximum likelihood estimation with exponential kernels: λ(t) = μ + Σ α·exp(-β(t-tᵢ)) fitted via iterative optimization
This Implementation: Simple exponential decay (0.9 multiplier) with binary event triggers (volume spike = event)
Impact: Captures self-exciting property but lacks parameter optimization; fixed decay rate may not suit all instruments
4. Kyle's Lambda Simplification:
Academic Implementation: Estimated via regression of price impact on signed order flow over multiple time intervals: Δp = λ × Δv + ε
This Implementation: Simplified ratio: price_change / sqrt(volume_sum) without proper signed order flow or regression
Impact: Provides directional indicator of impact but not true market depth measurement; no statistical confidence intervals
5. Entropy Calculation:
Academic Implementation: True Shannon entropy requires probability distribution: H(X) = -Σ p(x)·log₂(p(x)) where p(x) is probability of each price change magnitude
This Implementation: Simple ratio of unique price changes to total observations (variety measure)
Impact: Measures diversity but not true information entropy with probability weighting; less sensitive to distribution shape
6. Memory System Constraints:
Full ML Implementation: Neural networks with backpropagation, experience replay buffers (storing state-action-reward tuples), gradient descent optimization, and eligibility traces
This Implementation: Fixed-size array queues with simple averaging; no gradient-based learning, no state representation beyond raw scores
Impact: Cannot learn complex non-linear patterns; limited to linear performance tracking
7. Limited Feature Engineering:
Advanced Implementation: Dozens of engineered features, polynomial interactions (x², x³), dimensionality reduction (PCA, autoencoders), feature selection algorithms
This Implementation: Raw agent scores and basic market metrics (RSI, ATR, volume ratio); minimal transformation
Impact: May miss subtle cross-feature interactions; relies on agent-level intelligence rather than feature combinations
8. Single-Instrument Data:
Full Implementation: Multi-asset correlation analysis (sector ETFs, currency pairs, volatility indices like VIX), lead-lag relationships, risk-on/risk-off regimes
This Implementation: Only OHLCV data from displayed instrument
Impact: Cannot incorporate broader market context; vulnerable to correlated moves across assets
9. Fixed Performance Horizon:
Full Implementation: Adaptive horizon based on trade duration, volatility regime, or profit target achievement
This Implementation: Fixed 8-bar evaluation window
Impact: May evaluate too early in slow markets or too late in fast markets; one-size-fits-all approach
Performance Impact Summary:
These simplifications make the script:
✅ Faster: Executes in milliseconds vs. seconds (or minutes) for full academic implementations
✅ More Accessible: Runs on any TradingView plan without external data feeds, APIs, or compute servers
✅ More Transparent: All calculations visible in Pine Script (no black-box compiled models)
✅ Lower Resource Usage: <500 bars lookback, minimal memory footprint
⚠️ Less Precise: Approximations may reduce statistical edge by 5-15% vs. academic implementations
⚠️ Limited Scope: Cannot capture tick-level dynamics, multi-order-book interactions, or cross-asset flows
⚠️ Fixed Parameters: Some thresholds hardcoded rather than dynamically optimized
When to Upgrade to Full Implementation:
Consider professional Python/C++ versions with institutional data feeds if:
Trading with >$100K capital where precision differences materially impact returns
Operating in microsecond-competitive environments (HFT, market making)
Requiring regulatory-grade audit trails and reproducibility
Backtesting with tick-level precision for strategy validation
Need true real-time adaptation with neural network-based learning
For retail swing/day trading and position management, these approximations provide sufficient signal quality while maintaining usability, transparency, and accessibility. The core logic—multi-agent detection with adaptive selection—remains intact.
Technical Notes
All calculations use standard Pine Script built-in functions ( ta.ema, ta.atr, ta.rsi, ta.bb, ta.sma, ta.stdev, ta.vwap )
VPIN and Kyle's Lambda use simplified formulas optimized for OHLCV data (see "Lite" section above)
Thompson Sampling uses pseudo-random noise from price/volume decimal digits for beta distribution sampling
No repainting: All calculations use confirmed bar data (no forward-looking)
Maximum lookback: 500 bars (set via max_bars_back parameter)
Performance evaluation: 8-bar forward-looking window for reward calculation (clearly disclosed)
Confidence threshold: Minimum 0.25 (25%) enforced on all signals
Memory arrays: Dynamic sizing with FIFO queue management
Limitations and Disclaimers
Not Predictive: This indicator identifies patterns in historical data. It cannot predict future price movements with certainty.
Requires Human Judgment: Signals are entry triggers, not complete trading strategies. Must be confirmed with your own analysis, risk management rules, and market context.
Learning Period Required: The adaptive system requires 50-100 bars minimum to build statistically meaningful performance data for bandit algorithms.
Overfitting Risk: Restoring memory parameters from one market regime to a drastically different regime (e.g., low volatility to high volatility) may cause poor initial performance until system re-adapts.
Approximation Limitations: Simplified calculations (see "Lite" section) may underperform academic implementations by 5-15% in highly efficient markets.
No Guarantee of Profit: Past performance, whether backtested or live-traded, does not guarantee future performance. All trading involves risk of loss.
Forward-Looking Bias: Performance evaluation uses 8-bar forward window—this creates slight look-ahead for learning (though not for signals). Real-time performance may differ from indicator's internal statistics.
Single-Instrument Limitation: Does not account for correlations with related assets or broader market regime changes.
Recommended Settings
Timeframe: 15-minute to 4-hour charts (sufficient volatility for ATR-based stops; adequate bar volume for learning)
Assets: Liquid instruments with >100k daily volume (forex majors, large-cap stocks, BTC/ETH, major indices)
Not Recommended: Illiquid small-caps, penny stocks, low-volume altcoins (microstructure metrics unreliable)
Complementary Tools: Volume profile, order book depth, market breadth indicators, fundamental catalysts
Position Sizing: Risk no more than 1-2% of capital per signal using ATR-based stop-loss
Signal Filtering: Consider external confluence (support/resistance, trendlines, round numbers, session opens)
Start With: Balanced mode, Thompson Sampling, Blend mode, default agent sensitivities (1.0)
After 30+ Signals: Review agent win rates, consider increasing sensitivity of top performers or locking to dominant agent
Alert Configuration
The script includes built-in alert conditions:
Long Signal: Fires when validated long entry confirmed
Short Signal: Fires when validated short entry confirmed
Alerts fire once per bar (after confirmation requirements met)
Set alert to "Once Per Bar Close" for reliability
Taking you to school. — Dskyz, Trade with insight. Trade with anticipation.















